Check for FindNextFile when defining it rather than FindFirstFile
[oweals/openssl.git] / crypto / asn1 / t_x509.c
index 4f5d28f1abccac6cabbdb8bf3612744a2d4f337a..111ea5aaac72dd047023deb7ed4cb2aad6d76182 100644 (file)
@@ -138,7 +138,7 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
                if (BIO_write(bp,"        Serial Number:",22) <= 0) goto err;
 
                bs=X509_get_serialNumber(x);
-               if (bs->length <= sizeof(long))
+               if (bs->length <= (int)sizeof(long))
                        {
                        l=ASN1_INTEGER_get(bs);
                        if (bs->type == V_ASN1_NEG_INTEGER)
@@ -225,6 +225,24 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
                        }
                }
 
+       if(!(cflag & X509_FLAG_NO_IDS))
+               {
+               if (ci->issuerUID)
+                       {
+                       if (BIO_printf(bp,"%8sIssuer Unique ID: ","") <= 0) 
+                               goto err;
+                       if (!X509_signature_dump(bp, ci->issuerUID, 12))
+                               goto err;
+                       }
+               if (ci->subjectUID)
+                       {
+                       if (BIO_printf(bp,"%8sSubject Unique ID: ","") <= 0) 
+                               goto err;
+                       if (!X509_signature_dump(bp, ci->subjectUID, 12))
+                               goto err;
+                       }
+               }
+
        if (!(cflag & X509_FLAG_NO_EXTENSIONS))
                X509V3_extensions_print(bp, "X509v3 extensions",
                                        ci->extensions, cflag, 8);
@@ -475,6 +493,8 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
        l=80-2-obase;
 
        b=X509_NAME_oneline(name,NULL,0);
+       if (!b)
+               return 0;
        if (!*b)
                {
                OPENSSL_free(b);