[rs-commit] r103 - /redwax-tool/trunk/redwax_openssl.c

rs-commit at redwax.eu rs-commit at redwax.eu
Thu Dec 2 10:46:13 CET 2021


Author: minfrin at redwax.eu
Date: Thu Dec  2 10:46:12 2021
New Revision: 103

Log:
Handle NIDs undeclared in older OpenSSL.

Modified:
    redwax-tool/trunk/redwax_openssl.c

Modified: redwax-tool/trunk/redwax_openssl.c
==============================================================================
--- redwax-tool/trunk/redwax_openssl.c	(original)
+++ redwax-tool/trunk/redwax_openssl.c	Thu Dec  2 10:46:12 2021
@@ -2649,6 +2649,7 @@
 
         nid = OBJ_obj2nid(gen->d.otherName->type_id);
 
+#ifdef NID_SRVName
         if ((nid == NID_SRVName
              && gen->d.otherName->value->type != V_ASN1_IA5STRING)
                 || (nid != NID_SRVName
@@ -2659,38 +2660,47 @@
 
             break;
         }
+#endif
 
         switch (nid) {
+#ifdef NID_id_on_SmtpUTF8Mailbox
         case NID_id_on_SmtpUTF8Mailbox:
             key = "OtherName";
             okey = "SmtpUTF8Mailbox";
             BIO_printf(bio, "%s",
                        gen->d.otherName->value->value.utf8string->data);
             break;
+#endif
+#ifdef NID_XmppAddr
         case NID_XmppAddr:
             key = "OtherName";
             okey = "XmppAddr";
             BIO_printf(bio, "%s",
                        gen->d.otherName->value->value.utf8string->data);
             break;
+#endif
+#ifdef NID_SRVName
         case NID_SRVName:
             key = "OtherName";
             okey = "SRVName";
             BIO_printf(bio, "%s",
                        gen->d.otherName->value->value.ia5string->data);
             break;
+#endif
         case NID_ms_upn:
             key = "OtherName";
             okey = "UPN";
             BIO_printf(bio, "%s",
                        gen->d.otherName->value->value.utf8string->data);
             break;
+#ifdef NID_NAIRealm
         case NID_NAIRealm:
             key = "OtherName";
             okey = "NAIRealm";
             BIO_printf(bio, "%s",
                        gen->d.otherName->value->value.utf8string->data);
             break;
+#endif
         default:
 
             redwax_print_error(r, "metadata-out: unsupported othername with nid %d, ignoring\n",



More information about the rs-commit mailing list