]> granicus.if.org Git - openssl/commitdiff
Initialize digested data type in PKCS7_set_type().
authorDr. Stephen Henson <steve@openssl.org>
Fri, 10 Oct 2003 23:31:53 +0000 (23:31 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 10 Oct 2003 23:31:53 +0000 (23:31 +0000)
crypto/pkcs7/pk7_lib.c

index 9b647b212182a74eaadb04fc313a97555d439446..3812710618c69905087449bc98d503e374cee0bf 100644 (file)
@@ -197,6 +197,11 @@ int PKCS7_set_type(PKCS7 *p7, int type)
                break;
 
        case NID_pkcs7_digest:
+               p7->type=obj;
+               if ((p7->d.digest=PKCS7_DIGEST_new())
+                       == NULL) goto err;
+               ASN1_INTEGER_set(p7->d.digest->version,0);
+               break;
        default:
                PKCS7err(PKCS7_F_PKCS7_SET_TYPE,PKCS7_R_UNSUPPORTED_CONTENT_TYPE);
                goto err;