diff options
author | beck <> | 2015-02-11 03:55:42 +0000 |
---|---|---|
committer | beck <> | 2015-02-11 03:55:42 +0000 |
commit | 4a2309d8058f17b675c178c4996662495981382e (patch) | |
tree | 903be911a9730def1b91aa1ccd23138554dc4a4c /src | |
parent | e1b5dd72bfda4606540ea14d667fab19fb18b964 (diff) | |
download | openbsd-4a2309d8058f17b675c178c4996662495981382e.tar.gz openbsd-4a2309d8058f17b675c178c4996662495981382e.tar.bz2 openbsd-4a2309d8058f17b675c178c4996662495981382e.zip |
get rid of OPENSSL_NO_CMS code we do not use.
ok miod@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/cms/cms.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_ameth.c | 25 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 23 | ||||
-rw-r--r-- | src/lib/libcrypto/err/err_all.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/gost/gostr341001_ameth.c | 16 | ||||
-rw-r--r-- | src/lib/libcrypto/gost/gostr341001_pmeth.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_lib.c | 11 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_ameth.c | 16 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_pmeth.c | 25 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/cms/cms.h | 4 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/dsa/dsa_ameth.c | 25 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/ec/ec_ameth.c | 23 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/err/err_all.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/gost/gostr341001_ameth.c | 16 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/gost/gostr341001_pmeth.c | 7 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/pem/pem_lib.c | 11 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/rsa/rsa_ameth.c | 16 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/rsa/rsa_pmeth.c | 25 |
18 files changed, 24 insertions, 246 deletions
diff --git a/src/lib/libcrypto/cms/cms.h b/src/lib/libcrypto/cms/cms.h index 0e4aa6f9fc..f08e2f8457 100644 --- a/src/lib/libcrypto/cms/cms.h +++ b/src/lib/libcrypto/cms/cms.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms.h,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ | 1 | /* $OpenBSD: cms.h,v 1.6 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -58,9 +58,7 @@ | |||
58 | 58 | ||
59 | #include <openssl/x509.h> | 59 | #include <openssl/x509.h> |
60 | 60 | ||
61 | #ifdef OPENSSL_NO_CMS | ||
62 | #error CMS is disabled. | 61 | #error CMS is disabled. |
63 | #endif | ||
64 | 62 | ||
65 | #ifdef __cplusplus | 63 | #ifdef __cplusplus |
66 | extern "C" { | 64 | extern "C" { |
diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c index 20839b6207..8f7a73a481 100644 --- a/src/lib/libcrypto/dsa/dsa_ameth.c +++ b/src/lib/libcrypto/dsa/dsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_ameth.c,v 1.14 2014/07/13 12:45:01 miod Exp $ */ | 1 | /* $OpenBSD: dsa_ameth.c,v 1.15 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -66,9 +66,6 @@ | |||
66 | #include <openssl/err.h> | 66 | #include <openssl/err.h> |
67 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
68 | 68 | ||
69 | #ifndef OPENSSL_NO_CMS | ||
70 | #include <openssl/cms.h> | ||
71 | #endif | ||
72 | 69 | ||
73 | #include "asn1_locl.h" | 70 | #include "asn1_locl.h" |
74 | 71 | ||
@@ -595,26 +592,6 @@ dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
595 | 0); | 592 | 0); |
596 | } | 593 | } |
597 | return 1; | 594 | return 1; |
598 | #ifndef OPENSSL_NO_CMS | ||
599 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
600 | if (arg1 == 0) { | ||
601 | int snid, hnid; | ||
602 | X509_ALGOR *alg1, *alg2; | ||
603 | |||
604 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, &alg1, &alg2); | ||
605 | if (alg1 == NULL || alg1->algorithm == NULL) | ||
606 | return -1; | ||
607 | hnid = OBJ_obj2nid(alg1->algorithm); | ||
608 | if (hnid == NID_undef) | ||
609 | return -1; | ||
610 | if (!OBJ_find_sigid_by_algs(&snid, hnid, | ||
611 | EVP_PKEY_id(pkey))) | ||
612 | return -1; | ||
613 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, | ||
614 | 0); | ||
615 | } | ||
616 | return 1; | ||
617 | #endif | ||
618 | 595 | ||
619 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 596 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
620 | *(int *)arg2 = NID_sha1; | 597 | *(int *)arg2 = NID_sha1; |
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index b4ae1c0623..567d16e307 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_ameth.c,v 1.14 2014/10/07 04:58:50 miod Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.15 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -65,9 +65,6 @@ | |||
65 | #include <openssl/err.h> | 65 | #include <openssl/err.h> |
66 | #include <openssl/x509.h> | 66 | #include <openssl/x509.h> |
67 | 67 | ||
68 | #ifndef OPENSSL_NO_CMS | ||
69 | #include <openssl/cms.h> | ||
70 | #endif | ||
71 | 68 | ||
72 | #include "asn1_locl.h" | 69 | #include "asn1_locl.h" |
73 | 70 | ||
@@ -573,24 +570,6 @@ ec_pkey_ctrl(EVP_PKEY * pkey, int op, long arg1, void *arg2) | |||
573 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); | 570 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); |
574 | } | 571 | } |
575 | return 1; | 572 | return 1; |
576 | #ifndef OPENSSL_NO_CMS | ||
577 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
578 | if (arg1 == 0) { | ||
579 | int snid, hnid; | ||
580 | X509_ALGOR *alg1, *alg2; | ||
581 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, | ||
582 | &alg1, &alg2); | ||
583 | if (alg1 == NULL || alg1->algorithm == NULL) | ||
584 | return -1; | ||
585 | hnid = OBJ_obj2nid(alg1->algorithm); | ||
586 | if (hnid == NID_undef) | ||
587 | return -1; | ||
588 | if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey))) | ||
589 | return -1; | ||
590 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); | ||
591 | } | ||
592 | return 1; | ||
593 | #endif | ||
594 | 573 | ||
595 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 574 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
596 | *(int *) arg2 = NID_sha1; | 575 | *(int *) arg2 = NID_sha1; |
diff --git a/src/lib/libcrypto/err/err_all.c b/src/lib/libcrypto/err/err_all.c index e809d79496..296c1a5ba3 100644 --- a/src/lib/libcrypto/err/err_all.c +++ b/src/lib/libcrypto/err/err_all.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: err_all.c,v 1.20 2015/02/11 03:55:00 beck Exp $ */ | 1 | /* $OpenBSD: err_all.c,v 1.21 2015/02/11 03:55:42 beck 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 | * |
@@ -115,6 +115,9 @@ ERR_load_crypto_strings(void) | |||
115 | #ifndef OPENSSL_NO_RSA | 115 | #ifndef OPENSSL_NO_RSA |
116 | ERR_load_RSA_strings(); | 116 | ERR_load_RSA_strings(); |
117 | #endif | 117 | #endif |
118 | #ifndef OPENSSL_NO_COMP | ||
119 | #include <openssl/comp.h> | ||
120 | #endif | ||
118 | #ifndef OPENSSL_NO_DH | 121 | #ifndef OPENSSL_NO_DH |
119 | ERR_load_DH_strings(); | 122 | ERR_load_DH_strings(); |
120 | #endif | 123 | #endif |
@@ -151,9 +154,6 @@ ERR_load_crypto_strings(void) | |||
151 | #endif | 154 | #endif |
152 | ERR_load_OCSP_strings(); | 155 | ERR_load_OCSP_strings(); |
153 | ERR_load_UI_strings(); | 156 | ERR_load_UI_strings(); |
154 | #ifndef OPENSSL_NO_CMS | ||
155 | ERR_load_CMS_strings(); | ||
156 | #endif | ||
157 | #ifndef OPENSSL_NO_GOST | 157 | #ifndef OPENSSL_NO_GOST |
158 | ERR_load_GOST_strings(); | 158 | ERR_load_GOST_strings(); |
159 | #endif | 159 | #endif |
diff --git a/src/lib/libcrypto/gost/gostr341001_ameth.c b/src/lib/libcrypto/gost/gostr341001_ameth.c index fea6ef26dd..fb1d57ad6d 100644 --- a/src/lib/libcrypto/gost/gostr341001_ameth.c +++ b/src/lib/libcrypto/gost/gostr341001_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gostr341001_ameth.c,v 1.6 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: gostr341001_ameth.c,v 1.7 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
@@ -61,9 +61,6 @@ | |||
61 | #include <openssl/x509.h> | 61 | #include <openssl/x509.h> |
62 | #include <openssl/gost.h> | 62 | #include <openssl/gost.h> |
63 | 63 | ||
64 | #ifndef OPENSSL_NO_CMS | ||
65 | #include <openssl/cms.h> | ||
66 | #endif | ||
67 | 64 | ||
68 | #include "asn1_locl.h" | 65 | #include "asn1_locl.h" |
69 | #include "gost_locl.h" | 66 | #include "gost_locl.h" |
@@ -656,17 +653,6 @@ pkey_ctrl_gost01(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
656 | if (arg1 == 0) | 653 | if (arg1 == 0) |
657 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg3); | 654 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg3); |
658 | break; | 655 | break; |
659 | #ifndef OPENSSL_NO_CMS | ||
660 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
661 | if (arg1 == 0) | ||
662 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, &alg1, &alg2); | ||
663 | break; | ||
664 | |||
665 | case ASN1_PKEY_CTRL_CMS_ENVELOPE: | ||
666 | if (arg1 == 0) | ||
667 | CMS_RecipientInfo_ktri_get0_algs(arg2, NULL, NULL, &alg3); | ||
668 | break; | ||
669 | #endif | ||
670 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 656 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
671 | *(int *)arg2 = GostR3410_get_md_digest(digest); | 657 | *(int *)arg2 = GostR3410_get_md_digest(digest); |
672 | return 2; | 658 | return 2; |
diff --git a/src/lib/libcrypto/gost/gostr341001_pmeth.c b/src/lib/libcrypto/gost/gostr341001_pmeth.c index 8a71f814b2..89e1ae62cd 100644 --- a/src/lib/libcrypto/gost/gostr341001_pmeth.c +++ b/src/lib/libcrypto/gost/gostr341001_pmeth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gostr341001_pmeth.c,v 1.8 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: gostr341001_pmeth.c,v 1.9 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
@@ -597,11 +597,6 @@ pkey_gost01_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | |||
597 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: | 597 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: |
598 | case EVP_PKEY_CTRL_PKCS7_SIGN: | 598 | case EVP_PKEY_CTRL_PKCS7_SIGN: |
599 | case EVP_PKEY_CTRL_DIGESTINIT: | 599 | case EVP_PKEY_CTRL_DIGESTINIT: |
600 | #ifndef OPENSSL_NO_CMS | ||
601 | case EVP_PKEY_CTRL_CMS_ENCRYPT: | ||
602 | case EVP_PKEY_CTRL_CMS_DECRYPT: | ||
603 | case EVP_PKEY_CTRL_CMS_SIGN: | ||
604 | #endif | ||
605 | return 1; | 600 | return 1; |
606 | 601 | ||
607 | case EVP_PKEY_CTRL_GOST_PARAMSET: | 602 | case EVP_PKEY_CTRL_GOST_PARAMSET: |
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c index 011e9e36de..9107e9c225 100644 --- a/src/lib/libcrypto/pem/pem_lib.c +++ b/src/lib/libcrypto/pem/pem_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pem_lib.c,v 1.37 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: pem_lib.c,v 1.38 2015/02/11 03:55:42 beck 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 | * |
@@ -264,15 +264,6 @@ check_pem(const char *nm, const char *name) | |||
264 | !strcmp(name, PEM_STRING_PKCS7)) | 264 | !strcmp(name, PEM_STRING_PKCS7)) |
265 | return 1; | 265 | return 1; |
266 | 266 | ||
267 | #ifndef OPENSSL_NO_CMS | ||
268 | if (!strcmp(nm, PEM_STRING_X509) && | ||
269 | !strcmp(name, PEM_STRING_CMS)) | ||
270 | return 1; | ||
271 | /* Allow CMS to be read from PKCS#7 headers */ | ||
272 | if (!strcmp(nm, PEM_STRING_PKCS7) && | ||
273 | !strcmp(name, PEM_STRING_CMS)) | ||
274 | return 1; | ||
275 | #endif | ||
276 | 267 | ||
277 | return 0; | 268 | return 0; |
278 | } | 269 | } |
diff --git a/src/lib/libcrypto/rsa/rsa_ameth.c b/src/lib/libcrypto/rsa/rsa_ameth.c index f842a7c70c..a68fcbeb11 100644 --- a/src/lib/libcrypto/rsa/rsa_ameth.c +++ b/src/lib/libcrypto/rsa/rsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_ameth.c,v 1.12 2014/07/11 12:59:10 miod Exp $ */ | 1 | /* $OpenBSD: rsa_ameth.c,v 1.13 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -66,9 +66,6 @@ | |||
66 | #include <openssl/rsa.h> | 66 | #include <openssl/rsa.h> |
67 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
68 | 68 | ||
69 | #ifndef OPENSSL_NO_CMS | ||
70 | #include <openssl/cms.h> | ||
71 | #endif | ||
72 | 69 | ||
73 | #include "asn1_locl.h" | 70 | #include "asn1_locl.h" |
74 | 71 | ||
@@ -420,17 +417,6 @@ rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
420 | if (arg1 == 0) | 417 | if (arg1 == 0) |
421 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg); | 418 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg); |
422 | break; | 419 | break; |
423 | #ifndef OPENSSL_NO_CMS | ||
424 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
425 | if (arg1 == 0) | ||
426 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, NULL, &alg); | ||
427 | break; | ||
428 | |||
429 | case ASN1_PKEY_CTRL_CMS_ENVELOPE: | ||
430 | if (arg1 == 0) | ||
431 | CMS_RecipientInfo_ktri_get0_algs(arg2, NULL, NULL, &alg); | ||
432 | break; | ||
433 | #endif | ||
434 | 420 | ||
435 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 421 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
436 | *(int *)arg2 = NID_sha1; | 422 | *(int *)arg2 = NID_sha1; |
diff --git a/src/lib/libcrypto/rsa/rsa_pmeth.c b/src/lib/libcrypto/rsa/rsa_pmeth.c index 954190d560..6d38a7c923 100644 --- a/src/lib/libcrypto/rsa/rsa_pmeth.c +++ b/src/lib/libcrypto/rsa/rsa_pmeth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_pmeth.c,v 1.14 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_pmeth.c,v 1.15 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -69,9 +69,6 @@ | |||
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #include <openssl/x509.h> | 70 | #include <openssl/x509.h> |
71 | 71 | ||
72 | #ifndef OPENSSL_NO_CMS | ||
73 | #include <openssl/cms.h> | ||
74 | #endif | ||
75 | 72 | ||
76 | #include "evp_locl.h" | 73 | #include "evp_locl.h" |
77 | #include "rsa_locl.h" | 74 | #include "rsa_locl.h" |
@@ -462,26 +459,6 @@ bad_pad: | |||
462 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: | 459 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: |
463 | case EVP_PKEY_CTRL_PKCS7_SIGN: | 460 | case EVP_PKEY_CTRL_PKCS7_SIGN: |
464 | return 1; | 461 | return 1; |
465 | #ifndef OPENSSL_NO_CMS | ||
466 | case EVP_PKEY_CTRL_CMS_DECRYPT: | ||
467 | { | ||
468 | X509_ALGOR *alg = NULL; | ||
469 | ASN1_OBJECT *encalg = NULL; | ||
470 | |||
471 | if (p2) | ||
472 | CMS_RecipientInfo_ktri_get0_algs(p2, NULL, | ||
473 | NULL, &alg); | ||
474 | if (alg) | ||
475 | X509_ALGOR_get0(&encalg, NULL, NULL, alg); | ||
476 | if (encalg && OBJ_obj2nid(encalg) == NID_rsaesOaep) | ||
477 | rctx->pad_mode = RSA_PKCS1_OAEP_PADDING; | ||
478 | } | ||
479 | /* FALLTHROUGH */ | ||
480 | |||
481 | case EVP_PKEY_CTRL_CMS_ENCRYPT: | ||
482 | case EVP_PKEY_CTRL_CMS_SIGN: | ||
483 | return 1; | ||
484 | #endif | ||
485 | case EVP_PKEY_CTRL_PEER_KEY: | 462 | case EVP_PKEY_CTRL_PEER_KEY: |
486 | RSAerr(RSA_F_PKEY_RSA_CTRL, | 463 | RSAerr(RSA_F_PKEY_RSA_CTRL, |
487 | RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); | 464 | RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); |
diff --git a/src/lib/libssl/src/crypto/cms/cms.h b/src/lib/libssl/src/crypto/cms/cms.h index 0e4aa6f9fc..f08e2f8457 100644 --- a/src/lib/libssl/src/crypto/cms/cms.h +++ b/src/lib/libssl/src/crypto/cms/cms.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms.h,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ | 1 | /* $OpenBSD: cms.h,v 1.6 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -58,9 +58,7 @@ | |||
58 | 58 | ||
59 | #include <openssl/x509.h> | 59 | #include <openssl/x509.h> |
60 | 60 | ||
61 | #ifdef OPENSSL_NO_CMS | ||
62 | #error CMS is disabled. | 61 | #error CMS is disabled. |
63 | #endif | ||
64 | 62 | ||
65 | #ifdef __cplusplus | 63 | #ifdef __cplusplus |
66 | extern "C" { | 64 | extern "C" { |
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_ameth.c b/src/lib/libssl/src/crypto/dsa/dsa_ameth.c index 20839b6207..8f7a73a481 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_ameth.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_ameth.c,v 1.14 2014/07/13 12:45:01 miod Exp $ */ | 1 | /* $OpenBSD: dsa_ameth.c,v 1.15 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -66,9 +66,6 @@ | |||
66 | #include <openssl/err.h> | 66 | #include <openssl/err.h> |
67 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
68 | 68 | ||
69 | #ifndef OPENSSL_NO_CMS | ||
70 | #include <openssl/cms.h> | ||
71 | #endif | ||
72 | 69 | ||
73 | #include "asn1_locl.h" | 70 | #include "asn1_locl.h" |
74 | 71 | ||
@@ -595,26 +592,6 @@ dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
595 | 0); | 592 | 0); |
596 | } | 593 | } |
597 | return 1; | 594 | return 1; |
598 | #ifndef OPENSSL_NO_CMS | ||
599 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
600 | if (arg1 == 0) { | ||
601 | int snid, hnid; | ||
602 | X509_ALGOR *alg1, *alg2; | ||
603 | |||
604 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, &alg1, &alg2); | ||
605 | if (alg1 == NULL || alg1->algorithm == NULL) | ||
606 | return -1; | ||
607 | hnid = OBJ_obj2nid(alg1->algorithm); | ||
608 | if (hnid == NID_undef) | ||
609 | return -1; | ||
610 | if (!OBJ_find_sigid_by_algs(&snid, hnid, | ||
611 | EVP_PKEY_id(pkey))) | ||
612 | return -1; | ||
613 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, | ||
614 | 0); | ||
615 | } | ||
616 | return 1; | ||
617 | #endif | ||
618 | 595 | ||
619 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 596 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
620 | *(int *)arg2 = NID_sha1; | 597 | *(int *)arg2 = NID_sha1; |
diff --git a/src/lib/libssl/src/crypto/ec/ec_ameth.c b/src/lib/libssl/src/crypto/ec/ec_ameth.c index b4ae1c0623..567d16e307 100644 --- a/src/lib/libssl/src/crypto/ec/ec_ameth.c +++ b/src/lib/libssl/src/crypto/ec/ec_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_ameth.c,v 1.14 2014/10/07 04:58:50 miod Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.15 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -65,9 +65,6 @@ | |||
65 | #include <openssl/err.h> | 65 | #include <openssl/err.h> |
66 | #include <openssl/x509.h> | 66 | #include <openssl/x509.h> |
67 | 67 | ||
68 | #ifndef OPENSSL_NO_CMS | ||
69 | #include <openssl/cms.h> | ||
70 | #endif | ||
71 | 68 | ||
72 | #include "asn1_locl.h" | 69 | #include "asn1_locl.h" |
73 | 70 | ||
@@ -573,24 +570,6 @@ ec_pkey_ctrl(EVP_PKEY * pkey, int op, long arg1, void *arg2) | |||
573 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); | 570 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); |
574 | } | 571 | } |
575 | return 1; | 572 | return 1; |
576 | #ifndef OPENSSL_NO_CMS | ||
577 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
578 | if (arg1 == 0) { | ||
579 | int snid, hnid; | ||
580 | X509_ALGOR *alg1, *alg2; | ||
581 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, | ||
582 | &alg1, &alg2); | ||
583 | if (alg1 == NULL || alg1->algorithm == NULL) | ||
584 | return -1; | ||
585 | hnid = OBJ_obj2nid(alg1->algorithm); | ||
586 | if (hnid == NID_undef) | ||
587 | return -1; | ||
588 | if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey))) | ||
589 | return -1; | ||
590 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); | ||
591 | } | ||
592 | return 1; | ||
593 | #endif | ||
594 | 573 | ||
595 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 574 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
596 | *(int *) arg2 = NID_sha1; | 575 | *(int *) arg2 = NID_sha1; |
diff --git a/src/lib/libssl/src/crypto/err/err_all.c b/src/lib/libssl/src/crypto/err/err_all.c index e809d79496..296c1a5ba3 100644 --- a/src/lib/libssl/src/crypto/err/err_all.c +++ b/src/lib/libssl/src/crypto/err/err_all.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: err_all.c,v 1.20 2015/02/11 03:55:00 beck Exp $ */ | 1 | /* $OpenBSD: err_all.c,v 1.21 2015/02/11 03:55:42 beck 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 | * |
@@ -115,6 +115,9 @@ ERR_load_crypto_strings(void) | |||
115 | #ifndef OPENSSL_NO_RSA | 115 | #ifndef OPENSSL_NO_RSA |
116 | ERR_load_RSA_strings(); | 116 | ERR_load_RSA_strings(); |
117 | #endif | 117 | #endif |
118 | #ifndef OPENSSL_NO_COMP | ||
119 | #include <openssl/comp.h> | ||
120 | #endif | ||
118 | #ifndef OPENSSL_NO_DH | 121 | #ifndef OPENSSL_NO_DH |
119 | ERR_load_DH_strings(); | 122 | ERR_load_DH_strings(); |
120 | #endif | 123 | #endif |
@@ -151,9 +154,6 @@ ERR_load_crypto_strings(void) | |||
151 | #endif | 154 | #endif |
152 | ERR_load_OCSP_strings(); | 155 | ERR_load_OCSP_strings(); |
153 | ERR_load_UI_strings(); | 156 | ERR_load_UI_strings(); |
154 | #ifndef OPENSSL_NO_CMS | ||
155 | ERR_load_CMS_strings(); | ||
156 | #endif | ||
157 | #ifndef OPENSSL_NO_GOST | 157 | #ifndef OPENSSL_NO_GOST |
158 | ERR_load_GOST_strings(); | 158 | ERR_load_GOST_strings(); |
159 | #endif | 159 | #endif |
diff --git a/src/lib/libssl/src/crypto/gost/gostr341001_ameth.c b/src/lib/libssl/src/crypto/gost/gostr341001_ameth.c index fea6ef26dd..fb1d57ad6d 100644 --- a/src/lib/libssl/src/crypto/gost/gostr341001_ameth.c +++ b/src/lib/libssl/src/crypto/gost/gostr341001_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gostr341001_ameth.c,v 1.6 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: gostr341001_ameth.c,v 1.7 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
@@ -61,9 +61,6 @@ | |||
61 | #include <openssl/x509.h> | 61 | #include <openssl/x509.h> |
62 | #include <openssl/gost.h> | 62 | #include <openssl/gost.h> |
63 | 63 | ||
64 | #ifndef OPENSSL_NO_CMS | ||
65 | #include <openssl/cms.h> | ||
66 | #endif | ||
67 | 64 | ||
68 | #include "asn1_locl.h" | 65 | #include "asn1_locl.h" |
69 | #include "gost_locl.h" | 66 | #include "gost_locl.h" |
@@ -656,17 +653,6 @@ pkey_ctrl_gost01(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
656 | if (arg1 == 0) | 653 | if (arg1 == 0) |
657 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg3); | 654 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg3); |
658 | break; | 655 | break; |
659 | #ifndef OPENSSL_NO_CMS | ||
660 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
661 | if (arg1 == 0) | ||
662 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, &alg1, &alg2); | ||
663 | break; | ||
664 | |||
665 | case ASN1_PKEY_CTRL_CMS_ENVELOPE: | ||
666 | if (arg1 == 0) | ||
667 | CMS_RecipientInfo_ktri_get0_algs(arg2, NULL, NULL, &alg3); | ||
668 | break; | ||
669 | #endif | ||
670 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 656 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
671 | *(int *)arg2 = GostR3410_get_md_digest(digest); | 657 | *(int *)arg2 = GostR3410_get_md_digest(digest); |
672 | return 2; | 658 | return 2; |
diff --git a/src/lib/libssl/src/crypto/gost/gostr341001_pmeth.c b/src/lib/libssl/src/crypto/gost/gostr341001_pmeth.c index 8a71f814b2..89e1ae62cd 100644 --- a/src/lib/libssl/src/crypto/gost/gostr341001_pmeth.c +++ b/src/lib/libssl/src/crypto/gost/gostr341001_pmeth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gostr341001_pmeth.c,v 1.8 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: gostr341001_pmeth.c,v 1.9 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
@@ -597,11 +597,6 @@ pkey_gost01_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | |||
597 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: | 597 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: |
598 | case EVP_PKEY_CTRL_PKCS7_SIGN: | 598 | case EVP_PKEY_CTRL_PKCS7_SIGN: |
599 | case EVP_PKEY_CTRL_DIGESTINIT: | 599 | case EVP_PKEY_CTRL_DIGESTINIT: |
600 | #ifndef OPENSSL_NO_CMS | ||
601 | case EVP_PKEY_CTRL_CMS_ENCRYPT: | ||
602 | case EVP_PKEY_CTRL_CMS_DECRYPT: | ||
603 | case EVP_PKEY_CTRL_CMS_SIGN: | ||
604 | #endif | ||
605 | return 1; | 600 | return 1; |
606 | 601 | ||
607 | case EVP_PKEY_CTRL_GOST_PARAMSET: | 602 | case EVP_PKEY_CTRL_GOST_PARAMSET: |
diff --git a/src/lib/libssl/src/crypto/pem/pem_lib.c b/src/lib/libssl/src/crypto/pem/pem_lib.c index 011e9e36de..9107e9c225 100644 --- a/src/lib/libssl/src/crypto/pem/pem_lib.c +++ b/src/lib/libssl/src/crypto/pem/pem_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pem_lib.c,v 1.37 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: pem_lib.c,v 1.38 2015/02/11 03:55:42 beck 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 | * |
@@ -264,15 +264,6 @@ check_pem(const char *nm, const char *name) | |||
264 | !strcmp(name, PEM_STRING_PKCS7)) | 264 | !strcmp(name, PEM_STRING_PKCS7)) |
265 | return 1; | 265 | return 1; |
266 | 266 | ||
267 | #ifndef OPENSSL_NO_CMS | ||
268 | if (!strcmp(nm, PEM_STRING_X509) && | ||
269 | !strcmp(name, PEM_STRING_CMS)) | ||
270 | return 1; | ||
271 | /* Allow CMS to be read from PKCS#7 headers */ | ||
272 | if (!strcmp(nm, PEM_STRING_PKCS7) && | ||
273 | !strcmp(name, PEM_STRING_CMS)) | ||
274 | return 1; | ||
275 | #endif | ||
276 | 267 | ||
277 | return 0; | 268 | return 0; |
278 | } | 269 | } |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_ameth.c b/src/lib/libssl/src/crypto/rsa/rsa_ameth.c index f842a7c70c..a68fcbeb11 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_ameth.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_ameth.c,v 1.12 2014/07/11 12:59:10 miod Exp $ */ | 1 | /* $OpenBSD: rsa_ameth.c,v 1.13 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -66,9 +66,6 @@ | |||
66 | #include <openssl/rsa.h> | 66 | #include <openssl/rsa.h> |
67 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
68 | 68 | ||
69 | #ifndef OPENSSL_NO_CMS | ||
70 | #include <openssl/cms.h> | ||
71 | #endif | ||
72 | 69 | ||
73 | #include "asn1_locl.h" | 70 | #include "asn1_locl.h" |
74 | 71 | ||
@@ -420,17 +417,6 @@ rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
420 | if (arg1 == 0) | 417 | if (arg1 == 0) |
421 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg); | 418 | PKCS7_RECIP_INFO_get0_alg(arg2, &alg); |
422 | break; | 419 | break; |
423 | #ifndef OPENSSL_NO_CMS | ||
424 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
425 | if (arg1 == 0) | ||
426 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, NULL, &alg); | ||
427 | break; | ||
428 | |||
429 | case ASN1_PKEY_CTRL_CMS_ENVELOPE: | ||
430 | if (arg1 == 0) | ||
431 | CMS_RecipientInfo_ktri_get0_algs(arg2, NULL, NULL, &alg); | ||
432 | break; | ||
433 | #endif | ||
434 | 420 | ||
435 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 421 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
436 | *(int *)arg2 = NID_sha1; | 422 | *(int *)arg2 = NID_sha1; |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c b/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c index 954190d560..6d38a7c923 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_pmeth.c,v 1.14 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_pmeth.c,v 1.15 2015/02/11 03:55:42 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -69,9 +69,6 @@ | |||
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #include <openssl/x509.h> | 70 | #include <openssl/x509.h> |
71 | 71 | ||
72 | #ifndef OPENSSL_NO_CMS | ||
73 | #include <openssl/cms.h> | ||
74 | #endif | ||
75 | 72 | ||
76 | #include "evp_locl.h" | 73 | #include "evp_locl.h" |
77 | #include "rsa_locl.h" | 74 | #include "rsa_locl.h" |
@@ -462,26 +459,6 @@ bad_pad: | |||
462 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: | 459 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: |
463 | case EVP_PKEY_CTRL_PKCS7_SIGN: | 460 | case EVP_PKEY_CTRL_PKCS7_SIGN: |
464 | return 1; | 461 | return 1; |
465 | #ifndef OPENSSL_NO_CMS | ||
466 | case EVP_PKEY_CTRL_CMS_DECRYPT: | ||
467 | { | ||
468 | X509_ALGOR *alg = NULL; | ||
469 | ASN1_OBJECT *encalg = NULL; | ||
470 | |||
471 | if (p2) | ||
472 | CMS_RecipientInfo_ktri_get0_algs(p2, NULL, | ||
473 | NULL, &alg); | ||
474 | if (alg) | ||
475 | X509_ALGOR_get0(&encalg, NULL, NULL, alg); | ||
476 | if (encalg && OBJ_obj2nid(encalg) == NID_rsaesOaep) | ||
477 | rctx->pad_mode = RSA_PKCS1_OAEP_PADDING; | ||
478 | } | ||
479 | /* FALLTHROUGH */ | ||
480 | |||
481 | case EVP_PKEY_CTRL_CMS_ENCRYPT: | ||
482 | case EVP_PKEY_CTRL_CMS_SIGN: | ||
483 | return 1; | ||
484 | #endif | ||
485 | case EVP_PKEY_CTRL_PEER_KEY: | 462 | case EVP_PKEY_CTRL_PEER_KEY: |
486 | RSAerr(RSA_F_PKEY_RSA_CTRL, | 463 | RSAerr(RSA_F_PKEY_RSA_CTRL, |
487 | RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); | 464 | RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); |