|
Hi Pete, > 0044.00 ** Connection Description Info structure > 0045.00 D p_CnnDscInfo S * inz(*NULL) > 0046.00 D dsCnnDscInfo DS based(p_CnnDscInfo) > 0046.01 D dsLenCnnInfo 10I 0 > 0046.02 D dsCnnIntrAdd 20A > 0046.03 D dsCnnPwdVal 1A > 0046.04 D dsCnnWrkTyp 12A > 0050.01 D dsCnnSSLCnn 1A Heh... it always brings a smile to my face when I see my code resurface! and this is undoubtedly my code, with one difference... In my copy of this data structure, I don't have dsCnnSSLCnn. Did you add that? > Offset > Dec Hex Type Field > 0 0 INT(4) Length of connection description information > 4 4 CHAR(20) Client internet address > 24 18 CHAR(1) Client password validated > 25 19 CHAR(12) Workstation type > 39 27 CHAR(1) Secure socket layer connection > 40 28 CHAR(20) Server (local) internet address > 60 3C CHAR(1) Client authentication level > 61 3D CHAR(3) Reserved > 64 40 INT(4) Client certificate valid rc > 68 44 INT(4) Offset to client certificate > 72 48 INT(4) Client certificate length When you don't specify from & to positions in a data structure, and you don't specify overlay, the compiler simply puts the fields one after the other, so that they occupy contiguous bytes in the structure. If you know the size of each variable in the data structure, you can calculate the from/to positions, like this: D dsCnnDscInfo DS based(p_CnnDscInfo) D dsLenCnnInfo 10I 0 A "10I 0" field is 4 bytes long. Since it's at the start of the data structure, it'll take up positions 1-4. D dsCnnIntrAdd 20A This field goes immediately after the last one. Since the last one ended in position 4, this one starts in position 5. Since it's 20 bytes long, it occupies positions 5-24 D dsCnnPwdVal 1A again, right after... positions 25-25. D dsCnnWrkTyp 12A positions 26-37 D dsCnnSSLCnn 1A position 38 -- which is a problem because, according to the stuff you posted from the manual, it should start in position 40. Note that all of the others start in the correct position, but this one does not. There must be an undocumented 2-byte "reserved" field that's between dsCnnWrkTyp and dsCnnSSLCnn. ILE RPG has a neat feature that you can use to add spaces into a data structure -- you can define a field with no name just to take up space. I'd define the complete data structure as follows (untested): D dsCnnDscInfo DS based(p_CnnDscInfo) D dsCnnLen 10I 0 D dsCnnAddr 20A D dsCnnPWvalid 1A D dsCnnWStype 12A D 2A D dsCnnSSLCnn 1A D dsCnnSrvrIP 20A D dsCnnCliAuth 1A D 3A D dsCnnCrtRC 10I 0 D dsCnnCrtOff 10I 0 D dsCnnCrtLen 10I 0 Actually, if I had this project to do over, I'd switch it to use qualified data structures, but I wrote it before the QUALIFIED keyword was added to the language. > Just need a bit of direction so I know where to look for the SSL connection > flag. Hopefully I've answered that question. A note of caution about telnet exit programs: When defining a program like this, please be very careful about who has access to change it. When you set the "peAllowSignOn" parameter to '1' (or *ON) the system will allow people to auto-sign on. EVEN IF THEY HAVE THE WRONG PASSWORD. Only set peAutoSignOn = '1' if the dsCnnPWvalid field tells you that the password is valid. and then, make sure that the compiled *PGM object is locked down. Otherwise, a programmer could change peAllowSignOn to *ON, recompile it, log on as QSECOFR, and change it back... If you make it so that only people with *ALLOBJ can recompile this program, you shouldn't have any problems.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.