diff options
Diffstat (limited to 'src/lib/libcrypto/asn1')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_err.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/p5_pbe.c | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/p5_pbev2.c | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/t_req.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/x_pubkey.c | 2 |
5 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_err.c b/src/lib/libcrypto/asn1/asn1_err.c index b183814242..cecd555c88 100644 --- a/src/lib/libcrypto/asn1/asn1_err.c +++ b/src/lib/libcrypto/asn1/asn1_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/asn1/p5_pbe.c b/src/lib/libcrypto/asn1/p5_pbe.c index 64e90237cc..a147ac3295 100644 --- a/src/lib/libcrypto/asn1/p5_pbe.c +++ b/src/lib/libcrypto/asn1/p5_pbe.c | |||
@@ -129,7 +129,7 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, | |||
129 | } | 129 | } |
130 | pbe->salt->length = saltlen; | 130 | pbe->salt->length = saltlen; |
131 | if (salt) memcpy (pbe->salt->data, salt, saltlen); | 131 | if (salt) memcpy (pbe->salt->data, salt, saltlen); |
132 | else if (RAND_bytes (pbe->salt->data, saltlen) <= 0) | 132 | else if (RAND_pseudo_bytes (pbe->salt->data, saltlen) < 0) |
133 | return NULL; | 133 | return NULL; |
134 | 134 | ||
135 | if (!(astype = ASN1_TYPE_new())) { | 135 | if (!(astype = ASN1_TYPE_new())) { |
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c index 4ce06a94ab..1bbdb10c71 100644 --- a/src/lib/libcrypto/asn1/p5_pbev2.c +++ b/src/lib/libcrypto/asn1/p5_pbev2.c | |||
@@ -194,7 +194,8 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | |||
194 | if(!(scheme->parameter = ASN1_TYPE_new())) goto merr; | 194 | if(!(scheme->parameter = ASN1_TYPE_new())) goto merr; |
195 | 195 | ||
196 | /* Create random IV */ | 196 | /* Create random IV */ |
197 | RAND_pseudo_bytes(iv, EVP_CIPHER_iv_length(cipher)); | 197 | if (RAND_pseudo_bytes(iv, EVP_CIPHER_iv_length(cipher)) < 0) |
198 | goto err; | ||
198 | 199 | ||
199 | /* Dummy cipherinit to just setup the IV */ | 200 | /* Dummy cipherinit to just setup the IV */ |
200 | EVP_CipherInit(&ctx, cipher, NULL, iv, 0); | 201 | EVP_CipherInit(&ctx, cipher, NULL, iv, 0); |
@@ -212,7 +213,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | |||
212 | if (!(osalt->data = Malloc (saltlen))) goto merr; | 213 | if (!(osalt->data = Malloc (saltlen))) goto merr; |
213 | osalt->length = saltlen; | 214 | osalt->length = saltlen; |
214 | if (salt) memcpy (osalt->data, salt, saltlen); | 215 | if (salt) memcpy (osalt->data, salt, saltlen); |
215 | else if (RAND_bytes (osalt->data, saltlen) <= 0) goto merr; | 216 | else if (RAND_pseudo_bytes (osalt->data, saltlen) < 0) goto merr; |
216 | 217 | ||
217 | if(iter <= 0) iter = PKCS5_DEFAULT_ITER; | 218 | if(iter <= 0) iter = PKCS5_DEFAULT_ITER; |
218 | if(!ASN1_INTEGER_set(kdf->iter, iter)) goto merr; | 219 | if(!ASN1_INTEGER_set(kdf->iter, iter)) goto merr; |
diff --git a/src/lib/libcrypto/asn1/t_req.c b/src/lib/libcrypto/asn1/t_req.c index 81dd6355a8..ea1af092db 100644 --- a/src/lib/libcrypto/asn1/t_req.c +++ b/src/lib/libcrypto/asn1/t_req.c | |||
@@ -119,7 +119,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
119 | 119 | ||
120 | pkey=X509_REQ_get_pubkey(x); | 120 | pkey=X509_REQ_get_pubkey(x); |
121 | #ifndef NO_RSA | 121 | #ifndef NO_RSA |
122 | if (pkey->type == EVP_PKEY_RSA) | 122 | if (pkey != NULL && pkey->type == EVP_PKEY_RSA) |
123 | { | 123 | { |
124 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", | 124 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", |
125 | BN_num_bits(pkey->pkey.rsa->n)); | 125 | BN_num_bits(pkey->pkey.rsa->n)); |
@@ -128,7 +128,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
128 | else | 128 | else |
129 | #endif | 129 | #endif |
130 | #ifndef NO_DSA | 130 | #ifndef NO_DSA |
131 | if (pkey->type == EVP_PKEY_DSA) | 131 | if (pkey != NULL && pkey->type == EVP_PKEY_DSA) |
132 | { | 132 | { |
133 | BIO_printf(bp,"%12sDSA Public Key:\n",""); | 133 | BIO_printf(bp,"%12sDSA Public Key:\n",""); |
134 | DSA_print(bp,pkey->pkey.dsa,16); | 134 | DSA_print(bp,pkey->pkey.dsa,16); |
@@ -137,7 +137,8 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
137 | #endif | 137 | #endif |
138 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); | 138 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); |
139 | 139 | ||
140 | EVP_PKEY_free(pkey); | 140 | if (pkey != NULL) |
141 | EVP_PKEY_free(pkey); | ||
141 | 142 | ||
142 | /* may not be */ | 143 | /* may not be */ |
143 | sprintf(str,"%8sAttributes:\n",""); | 144 | sprintf(str,"%8sAttributes:\n",""); |
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c index 81e9815222..7a05d575c9 100644 --- a/src/lib/libcrypto/asn1/x_pubkey.c +++ b/src/lib/libcrypto/asn1/x_pubkey.c | |||
@@ -183,8 +183,10 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) | |||
183 | 183 | ||
184 | Free(s); | 184 | Free(s); |
185 | 185 | ||
186 | #if 0 | ||
186 | CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); | 187 | CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); |
187 | pk->pkey=pkey; | 188 | pk->pkey=pkey; |
189 | #endif | ||
188 | 190 | ||
189 | if (*x != NULL) | 191 | if (*x != NULL) |
190 | X509_PUBKEY_free(*x); | 192 | X509_PUBKEY_free(*x); |