× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm having a lot of trouble trying to parse a certificate and found no
references in the archive or google groups.  I want to check some
information in a certificate from my telnet exit point program.

It's quite likely I'm doing something wrong!

I'll try to paste in the relevant portions.  If anyone sees anything wrong
or missing, I'd greatly appreciate the info.

     D ParseCert       PR                  ExtProc('QsyParseCertificate')
     D   Certificate              32766A   const options(*varsize)
     D   CertType                    10I 0 const
     D   CertLen                     10I 0 const
     D   CertFmt                      8A   const
     D   CertRcvr                 32766A   options(*varsize)
     D   CertRcvrLen                 10I 0 const
     D   CertErr                  32766A   options(*varsize)

     D p_Crt           S               *
     D Crt             S          32766A   based(p_Crt)
     D CrtType         S             10I 0 Inz(1)
     D CrtRcvrLen      S             10I 0 Inz(32766)

** Connection information provided by telnet server (this part is apparently
working since I get the IP address and SSL flags.)

     D p_CnnDscInfo    S               *   inz(*NULL)
     D dsCnnDscInfo    DS                  based(p_CnnDscInfo)
     D  dsCnnLen                     10I 0
     D  dsCnnAddr                    20A
Client IP address
     D  dsCnnPWvalid                  1A
     D  dsCnnWStype                  12A
     D  dsCnnRsv1                     2A
Part of WStype?
     D  dsCnnSSL                      1A
     D  dsCnnSvrAddr                 20A
Server IP address
     D  dsCnnClAut                    1A
Client Auth Level
     D  dsCnnRsv2                     3A
     D  dsCnnCertVld                 10I 0
     D  dsCnnCertOff                 10I 0
Offset to Cert
     D  dsCnnCertLen                 10I 0
Certificate Length

     D p_Cert          S               *   inz(*NULL)
     D dsCert          DS                  based(p_Cert)
     D  dsCertCNOff          105    108I 0
Common Name (user)

     c                   eval      p_Crt = p_CnnDscInfo + dsCnnCertOff
     c                   alloc     32766         p_Cert
     c                   callp     ParseCert(Crt : CrtType : CrtRcvrLen
     c                             : 'CERT0200' : dsCert : CrtRcvrLen :
dsEC)

At this point I believe dsCertCNOff should have the offset to the Common
Name on the certificate.  Every time I try it, I get 0.  The API doc says
"If ... the offset to a field is 0, then the field does not contain any
information."  I know the CN of the cert does contain information.

I've tried certificate type 1 and 3; I've tried format CERT0210 as well.


Any ideas?  Have I provided enough info?

Thanks, all!


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.