diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/pkcs7/dec.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/libcrypto/pkcs7/dec.c b/src/lib/libcrypto/pkcs7/dec.c index b3661f28d3..6752ec568a 100644 --- a/src/lib/libcrypto/pkcs7/dec.c +++ b/src/lib/libcrypto/pkcs7/dec.c | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | */ | 57 | */ |
| 58 | #include <stdio.h> | 58 | #include <stdio.h> |
| 59 | #include <stdlib.h> | 59 | #include <stdlib.h> |
| 60 | #include <string.h> | ||
| 60 | #include <openssl/bio.h> | 61 | #include <openssl/bio.h> |
| 61 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
| 62 | #include <openssl/pem.h> | 63 | #include <openssl/pem.h> |
| @@ -85,7 +86,7 @@ char *argv[]; | |||
| 85 | int i,printit=0; | 86 | int i,printit=0; |
| 86 | STACK_OF(PKCS7_SIGNER_INFO) *sk; | 87 | STACK_OF(PKCS7_SIGNER_INFO) *sk; |
| 87 | 88 | ||
| 88 | SSLeay_add_all_algorithms(); | 89 | OpenSSL_add_all_algorithms(); |
| 89 | bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); | 90 | bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); |
| 90 | 91 | ||
| 91 | data=BIO_new(BIO_s_file()); | 92 | data=BIO_new(BIO_s_file()); |
| @@ -121,9 +122,10 @@ char *argv[]; | |||
| 121 | } | 122 | } |
| 122 | 123 | ||
| 123 | if ((in=BIO_new_file(keyfile,"r")) == NULL) goto err; | 124 | if ((in=BIO_new_file(keyfile,"r")) == NULL) goto err; |
| 124 | if ((x509=PEM_read_bio_X509(in,NULL,NULL)) == NULL) goto err; | 125 | if ((x509=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL) goto err; |
| 125 | BIO_reset(in); | 126 | BIO_reset(in); |
| 126 | if ((pkey=PEM_read_bio_PrivateKey(in,NULL,NULL)) == NULL) goto err; | 127 | if ((pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,NULL)) == NULL) |
| 128 | goto err; | ||
| 127 | BIO_free(in); | 129 | BIO_free(in); |
| 128 | 130 | ||
| 129 | if (pp == NULL) | 131 | if (pp == NULL) |
| @@ -131,7 +133,7 @@ char *argv[]; | |||
| 131 | 133 | ||
| 132 | 134 | ||
| 133 | /* Load the PKCS7 object from a file */ | 135 | /* Load the PKCS7 object from a file */ |
| 134 | if ((p7=PEM_read_bio_PKCS7(data,NULL,NULL)) == NULL) goto err; | 136 | if ((p7=PEM_read_bio_PKCS7(data,NULL,NULL,NULL)) == NULL) goto err; |
| 135 | 137 | ||
| 136 | 138 | ||
| 137 | 139 | ||
| @@ -148,7 +150,7 @@ char *argv[]; | |||
| 148 | /* We need to process the data */ | 150 | /* We need to process the data */ |
| 149 | /* We cannot support detached encryption */ | 151 | /* We cannot support detached encryption */ |
| 150 | p7bio=PKCS7_dataDecode(p7,pkey,detached,x509); | 152 | p7bio=PKCS7_dataDecode(p7,pkey,detached,x509); |
| 151 | 153 | ||
| 152 | if (p7bio == NULL) | 154 | if (p7bio == NULL) |
| 153 | { | 155 | { |
| 154 | printf("problems decoding\n"); | 156 | printf("problems decoding\n"); |
