diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/pkcs7/pk7_lib.c | 34 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/pkcs7/pk7_lib.c | 34 |
2 files changed, 36 insertions, 32 deletions
diff --git a/src/lib/libcrypto/pkcs7/pk7_lib.c b/src/lib/libcrypto/pkcs7/pk7_lib.c index 9eed9fc74a..63b73f88aa 100644 --- a/src/lib/libcrypto/pkcs7/pk7_lib.c +++ b/src/lib/libcrypto/pkcs7/pk7_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pk7_lib.c,v 1.11 2014/06/29 17:05:36 jsing Exp $ */ | 1 | /* $OpenBSD: pk7_lib.c,v 1.12 2014/07/08 09:08:27 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -184,37 +184,38 @@ PKCS7_set_type(PKCS7 *p7, int type) | |||
184 | break; | 184 | break; |
185 | case NID_pkcs7_signedAndEnveloped: | 185 | case NID_pkcs7_signedAndEnveloped: |
186 | p7->type = obj; | 186 | p7->type = obj; |
187 | if ((p7->d.signed_and_enveloped = PKCS7_SIGN_ENVELOPE_new()) | 187 | if ((p7->d.signed_and_enveloped = |
188 | == NULL) goto err; | 188 | PKCS7_SIGN_ENVELOPE_new()) == NULL) |
189 | goto err; | ||
189 | ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1); | 190 | ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1); |
190 | if (!ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1)) | 191 | if (!ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1)) |
191 | goto err; | 192 | goto err; |
192 | p7->d.signed_and_enveloped->enc_data->content_type | 193 | p7->d.signed_and_enveloped->enc_data->content_type = |
193 | = OBJ_nid2obj(NID_pkcs7_data); | 194 | OBJ_nid2obj(NID_pkcs7_data); |
194 | break; | 195 | break; |
195 | case NID_pkcs7_enveloped: | 196 | case NID_pkcs7_enveloped: |
196 | p7->type = obj; | 197 | p7->type = obj; |
197 | if ((p7->d.enveloped = PKCS7_ENVELOPE_new()) | 198 | if ((p7->d.enveloped = PKCS7_ENVELOPE_new()) == NULL) |
198 | == NULL) goto err; | 199 | goto err; |
199 | if (!ASN1_INTEGER_set(p7->d.enveloped->version, 0)) | 200 | if (!ASN1_INTEGER_set(p7->d.enveloped->version, 0)) |
200 | goto err; | 201 | goto err; |
201 | p7->d.enveloped->enc_data->content_type | 202 | p7->d.enveloped->enc_data->content_type = |
202 | = OBJ_nid2obj(NID_pkcs7_data); | 203 | OBJ_nid2obj(NID_pkcs7_data); |
203 | break; | 204 | break; |
204 | case NID_pkcs7_encrypted: | 205 | case NID_pkcs7_encrypted: |
205 | p7->type = obj; | 206 | p7->type = obj; |
206 | if ((p7->d.encrypted = PKCS7_ENCRYPT_new()) | 207 | if ((p7->d.encrypted = PKCS7_ENCRYPT_new()) == NULL) |
207 | == NULL) goto err; | 208 | goto err; |
208 | if (!ASN1_INTEGER_set(p7->d.encrypted->version, 0)) | 209 | if (!ASN1_INTEGER_set(p7->d.encrypted->version, 0)) |
209 | goto err; | 210 | goto err; |
210 | p7->d.encrypted->enc_data->content_type | 211 | p7->d.encrypted->enc_data->content_type = |
211 | = OBJ_nid2obj(NID_pkcs7_data); | 212 | OBJ_nid2obj(NID_pkcs7_data); |
212 | break; | 213 | break; |
213 | 214 | ||
214 | case NID_pkcs7_digest: | 215 | case NID_pkcs7_digest: |
215 | p7->type = obj; | 216 | p7->type = obj; |
216 | if ((p7->d.digest = PKCS7_DIGEST_new()) | 217 | if ((p7->d.digest = PKCS7_DIGEST_new()) == NULL) |
217 | == NULL) goto err; | 218 | goto err; |
218 | if (!ASN1_INTEGER_set(p7->d.digest->version, 0)) | 219 | if (!ASN1_INTEGER_set(p7->d.digest->version, 0)) |
219 | goto err; | 220 | goto err; |
220 | break; | 221 | break; |
@@ -454,7 +455,8 @@ PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md) | |||
454 | return 1; | 455 | return 1; |
455 | } | 456 | } |
456 | 457 | ||
457 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7) | 458 | STACK_OF(PKCS7_SIGNER_INFO) * |
459 | PKCS7_get_signer_info(PKCS7 *p7) | ||
458 | { | 460 | { |
459 | if (PKCS7_type_is_signed(p7)) { | 461 | if (PKCS7_type_is_signed(p7)) { |
460 | return (p7->d.sign->signer_info); | 462 | return (p7->d.sign->signer_info); |
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c b/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c index 9eed9fc74a..63b73f88aa 100644 --- a/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c +++ b/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pk7_lib.c,v 1.11 2014/06/29 17:05:36 jsing Exp $ */ | 1 | /* $OpenBSD: pk7_lib.c,v 1.12 2014/07/08 09:08:27 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -184,37 +184,38 @@ PKCS7_set_type(PKCS7 *p7, int type) | |||
184 | break; | 184 | break; |
185 | case NID_pkcs7_signedAndEnveloped: | 185 | case NID_pkcs7_signedAndEnveloped: |
186 | p7->type = obj; | 186 | p7->type = obj; |
187 | if ((p7->d.signed_and_enveloped = PKCS7_SIGN_ENVELOPE_new()) | 187 | if ((p7->d.signed_and_enveloped = |
188 | == NULL) goto err; | 188 | PKCS7_SIGN_ENVELOPE_new()) == NULL) |
189 | goto err; | ||
189 | ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1); | 190 | ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1); |
190 | if (!ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1)) | 191 | if (!ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1)) |
191 | goto err; | 192 | goto err; |
192 | p7->d.signed_and_enveloped->enc_data->content_type | 193 | p7->d.signed_and_enveloped->enc_data->content_type = |
193 | = OBJ_nid2obj(NID_pkcs7_data); | 194 | OBJ_nid2obj(NID_pkcs7_data); |
194 | break; | 195 | break; |
195 | case NID_pkcs7_enveloped: | 196 | case NID_pkcs7_enveloped: |
196 | p7->type = obj; | 197 | p7->type = obj; |
197 | if ((p7->d.enveloped = PKCS7_ENVELOPE_new()) | 198 | if ((p7->d.enveloped = PKCS7_ENVELOPE_new()) == NULL) |
198 | == NULL) goto err; | 199 | goto err; |
199 | if (!ASN1_INTEGER_set(p7->d.enveloped->version, 0)) | 200 | if (!ASN1_INTEGER_set(p7->d.enveloped->version, 0)) |
200 | goto err; | 201 | goto err; |
201 | p7->d.enveloped->enc_data->content_type | 202 | p7->d.enveloped->enc_data->content_type = |
202 | = OBJ_nid2obj(NID_pkcs7_data); | 203 | OBJ_nid2obj(NID_pkcs7_data); |
203 | break; | 204 | break; |
204 | case NID_pkcs7_encrypted: | 205 | case NID_pkcs7_encrypted: |
205 | p7->type = obj; | 206 | p7->type = obj; |
206 | if ((p7->d.encrypted = PKCS7_ENCRYPT_new()) | 207 | if ((p7->d.encrypted = PKCS7_ENCRYPT_new()) == NULL) |
207 | == NULL) goto err; | 208 | goto err; |
208 | if (!ASN1_INTEGER_set(p7->d.encrypted->version, 0)) | 209 | if (!ASN1_INTEGER_set(p7->d.encrypted->version, 0)) |
209 | goto err; | 210 | goto err; |
210 | p7->d.encrypted->enc_data->content_type | 211 | p7->d.encrypted->enc_data->content_type = |
211 | = OBJ_nid2obj(NID_pkcs7_data); | 212 | OBJ_nid2obj(NID_pkcs7_data); |
212 | break; | 213 | break; |
213 | 214 | ||
214 | case NID_pkcs7_digest: | 215 | case NID_pkcs7_digest: |
215 | p7->type = obj; | 216 | p7->type = obj; |
216 | if ((p7->d.digest = PKCS7_DIGEST_new()) | 217 | if ((p7->d.digest = PKCS7_DIGEST_new()) == NULL) |
217 | == NULL) goto err; | 218 | goto err; |
218 | if (!ASN1_INTEGER_set(p7->d.digest->version, 0)) | 219 | if (!ASN1_INTEGER_set(p7->d.digest->version, 0)) |
219 | goto err; | 220 | goto err; |
220 | break; | 221 | break; |
@@ -454,7 +455,8 @@ PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md) | |||
454 | return 1; | 455 | return 1; |
455 | } | 456 | } |
456 | 457 | ||
457 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7) | 458 | STACK_OF(PKCS7_SIGNER_INFO) * |
459 | PKCS7_get_signer_info(PKCS7 *p7) | ||
458 | { | 460 | { |
459 | if (PKCS7_type_is_signed(p7)) { | 461 | if (PKCS7_type_is_signed(p7)) { |
460 | return (p7->d.sign->signer_info); | 462 | return (p7->d.sign->signer_info); |