Don't try to print PBE information if it can't be decoded.
authorDr. Stephen Henson <steve@openssl.org>
Wed, 17 May 2006 18:24:35 +0000 (18:24 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 17 May 2006 18:24:35 +0000 (18:24 +0000)
apps/pkcs12.c

index 781aeb3..037aa3f 100644 (file)
@@ -807,12 +807,14 @@ int alg_print (BIO *x, X509_ALGOR *alg)
        PBEPARAM *pbe;
        const unsigned char *p;
        p = alg->parameter->value.sequence->data;
-       pbe = d2i_PBEPARAM (NULL, &p, alg->parameter->value.sequence->length);
+       pbe = d2i_PBEPARAM(NULL, &p, alg->parameter->value.sequence->length);
+       if (!pbe)
+               return 1;
        BIO_printf (bio_err, "%s, Iteration %ld\n", 
                OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)),
                ASN1_INTEGER_get(pbe->iter));
        PBEPARAM_free (pbe);
-       return 0;
+       return 1;
 }
 
 /* Load all certificates from a given file */