Import of old SSLeay release: SSLeay 0.9.1b (unreleased)
[openssl.git] / crypto / pkcs7 / enc.c
index 625a7c2285226b6ee83c3dd17848658afd4328d0..8c3f937cfcfc6695a7230a08febc118cbd1fc7bc 100644 (file)
@@ -73,10 +73,10 @@ char *argv[];
        BIO *data,*p7bio;
        char buf[1024*4];
        int i,j;
-       int nodetach=0;
+       int nodetach=1;
 
        EVP_add_digest(EVP_sha1());
-       EVP_add_cipher(EVP_des_cbc());
+       EVP_add_cipher(EVP_des_ede3_cbc());
 
        data=BIO_new(BIO_s_file());
 again:
@@ -105,7 +105,7 @@ again:
         
        if (PKCS7_add_signature(p7,x509,pkey,EVP_sha1()) == NULL) goto err;
 
-       if (!PKCS7_set_cipher(p7,EVP_des_cbc())) goto err;
+       if (!PKCS7_set_cipher(p7,EVP_des_ede3_cbc())) goto err;
        if (PKCS7_add_recipient(p7,x509) == NULL) goto err;
 
        /* we may want to add more */
@@ -129,7 +129,7 @@ again:
                }
        BIO_flush(p7bio);
 
-       if (!PKCS7_dataSign(p7,p7bio)) goto err;
+       if (!PKCS7_dataFinal(p7,p7bio)) goto err;
        BIO_free(p7bio);
 
        PEM_write_PKCS7(stdout,p7);