diff options
| author | jsing <> | 2016-10-19 16:49:11 +0000 |
|---|---|---|
| committer | jsing <> | 2016-10-19 16:49:11 +0000 |
| commit | 32993d77e030496e89e508d70d0fb7a85cd0787f (patch) | |
| tree | 3232d4e14c244b635cf7b2be923782ede6e3f4b0 /src | |
| parent | bf2e4fbd312b229ea2846ec4cb8bc0c0222e4850 (diff) | |
| download | openbsd-32993d77e030496e89e508d70d0fb7a85cd0787f.tar.gz openbsd-32993d77e030496e89e508d70d0fb7a85cd0787f.tar.bz2 openbsd-32993d77e030496e89e508d70d0fb7a85cd0787f.zip | |
unifdef OPENSSL_NO_CMS
Diffstat (limited to 'src')
| -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 |
8 files changed, 8 insertions, 123 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c index a6e21a688e..3e434701aa 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.19 2016/03/01 07:04:41 doug Exp $ */ | 1 | /* $OpenBSD: dsa_ameth.c,v 1.20 2016/10/19 16:49:11 jsing 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 | ||
| @@ -606,26 +603,6 @@ dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
| 606 | 0); | 603 | 0); |
| 607 | } | 604 | } |
| 608 | return 1; | 605 | return 1; |
| 609 | #ifndef OPENSSL_NO_CMS | ||
| 610 | case ASN1_PKEY_CTRL_CMS_SIGN: | ||
| 611 | if (arg1 == 0) { | ||
| 612 | int snid, hnid; | ||
| 613 | X509_ALGOR *alg1, *alg2; | ||
| 614 | |||
| 615 | CMS_SignerInfo_get0_algs(arg2, NULL, NULL, &alg1, &alg2); | ||
| 616 | if (alg1 == NULL || alg1->algorithm == NULL) | ||
| 617 | return -1; | ||
| 618 | hnid = OBJ_obj2nid(alg1->algorithm); | ||
| 619 | if (hnid == NID_undef) | ||
| 620 | return -1; | ||
| 621 | if (!OBJ_find_sigid_by_algs(&snid, hnid, | ||
| 622 | EVP_PKEY_id(pkey))) | ||
| 623 | return -1; | ||
| 624 | X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, | ||
| 625 | 0); | ||
| 626 | } | ||
| 627 | return 1; | ||
| 628 | #endif | ||
| 629 | 606 | ||
| 630 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: | 607 | case ASN1_PKEY_CTRL_DEFAULT_MD_NID: |
| 631 | *(int *)arg2 = NID_sha1; | 608 | *(int *)arg2 = NID_sha1; |
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index dd1c31883e..0dab68d5fe 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.16 2015/02/11 04:05:14 beck Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.17 2016/10/19 16:49:11 jsing 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 58adce64e7..40009cbe88 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.22 2015/02/11 04:05:14 beck Exp $ */ | 1 | /* $OpenBSD: err_all.c,v 1.23 2016/10/19 16:49:11 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 | * |
| @@ -78,9 +78,6 @@ | |||
| 78 | #include <openssl/x509.h> | 78 | #include <openssl/x509.h> |
| 79 | #include <openssl/x509v3.h> | 79 | #include <openssl/x509v3.h> |
| 80 | 80 | ||
| 81 | #ifndef OPENSSL_NO_CMS | ||
| 82 | #include <openssl/cms.h> | ||
| 83 | #endif | ||
| 84 | #ifndef OPENSSL_NO_DH | 81 | #ifndef OPENSSL_NO_DH |
| 85 | #include <openssl/dh.h> | 82 | #include <openssl/dh.h> |
| 86 | #endif | 83 | #endif |
| @@ -151,9 +148,6 @@ ERR_load_crypto_strings(void) | |||
| 151 | #endif | 148 | #endif |
| 152 | ERR_load_OCSP_strings(); | 149 | ERR_load_OCSP_strings(); |
| 153 | ERR_load_UI_strings(); | 150 | ERR_load_UI_strings(); |
| 154 | #ifndef OPENSSL_NO_CMS | ||
| 155 | ERR_load_CMS_strings(); | ||
| 156 | #endif | ||
| 157 | #ifndef OPENSSL_NO_GOST | 151 | #ifndef OPENSSL_NO_GOST |
| 158 | ERR_load_GOST_strings(); | 152 | ERR_load_GOST_strings(); |
| 159 | #endif | 153 | #endif |
diff --git a/src/lib/libcrypto/gost/gostr341001_ameth.c b/src/lib/libcrypto/gost/gostr341001_ameth.c index 3153d2f2eb..bb569ea846 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.9 2015/02/14 06:40:04 jsing Exp $ */ | 1 | /* $OpenBSD: gostr341001_ameth.c,v 1.10 2016/10/19 16:49:11 jsing 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 1454f3f0a2..30a066612f 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.12 2015/02/14 15:08:37 miod Exp $ */ | 1 | /* $OpenBSD: gostr341001_pmeth.c,v 1.13 2016/10/19 16:49:11 jsing 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 |
| @@ -598,11 +598,6 @@ pkey_gost01_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | |||
| 598 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: | 598 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: |
| 599 | case EVP_PKEY_CTRL_PKCS7_SIGN: | 599 | case EVP_PKEY_CTRL_PKCS7_SIGN: |
| 600 | case EVP_PKEY_CTRL_DIGESTINIT: | 600 | case EVP_PKEY_CTRL_DIGESTINIT: |
| 601 | #ifndef OPENSSL_NO_CMS | ||
| 602 | case EVP_PKEY_CTRL_CMS_ENCRYPT: | ||
| 603 | case EVP_PKEY_CTRL_CMS_DECRYPT: | ||
| 604 | case EVP_PKEY_CTRL_CMS_SIGN: | ||
| 605 | #endif | ||
| 606 | return 1; | 601 | return 1; |
| 607 | 602 | ||
| 608 | case EVP_PKEY_CTRL_GOST_PARAMSET: | 603 | 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 852b0eaf86..7178c8744f 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.42 2015/09/10 15:56:25 jsing Exp $ */ | 1 | /* $OpenBSD: pem_lib.c,v 1.43 2016/10/19 16:49:11 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 | * |
| @@ -265,15 +265,6 @@ check_pem(const char *nm, const char *name) | |||
| 265 | !strcmp(name, PEM_STRING_PKCS7)) | 265 | !strcmp(name, PEM_STRING_PKCS7)) |
| 266 | return 1; | 266 | return 1; |
| 267 | 267 | ||
| 268 | #ifndef OPENSSL_NO_CMS | ||
| 269 | if (!strcmp(nm, PEM_STRING_X509) && | ||
| 270 | !strcmp(name, PEM_STRING_CMS)) | ||
| 271 | return 1; | ||
| 272 | /* Allow CMS to be read from PKCS#7 headers */ | ||
| 273 | if (!strcmp(nm, PEM_STRING_PKCS7) && | ||
| 274 | !strcmp(name, PEM_STRING_CMS)) | ||
| 275 | return 1; | ||
| 276 | #endif | ||
| 277 | 268 | ||
| 278 | return 0; | 269 | return 0; |
| 279 | } | 270 | } |
diff --git a/src/lib/libcrypto/rsa/rsa_ameth.c b/src/lib/libcrypto/rsa/rsa_ameth.c index b66c749293..8faddcee1c 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.15 2015/12/03 23:03:10 beck Exp $ */ | 1 | /* $OpenBSD: rsa_ameth.c,v 1.16 2016/10/19 16:49:11 jsing 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 0b648138ee..4b7fc09514 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.17 2015/06/20 01:07:25 doug Exp $ */ | 1 | /* $OpenBSD: rsa_pmeth.c,v 1.18 2016/10/19 16:49:11 jsing 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" |
| @@ -451,26 +448,6 @@ bad_pad: | |||
| 451 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: | 448 | case EVP_PKEY_CTRL_PKCS7_DECRYPT: |
| 452 | case EVP_PKEY_CTRL_PKCS7_SIGN: | 449 | case EVP_PKEY_CTRL_PKCS7_SIGN: |
| 453 | return 1; | 450 | return 1; |
| 454 | #ifndef OPENSSL_NO_CMS | ||
| 455 | case EVP_PKEY_CTRL_CMS_DECRYPT: | ||
| 456 | { | ||
| 457 | X509_ALGOR *alg = NULL; | ||
| 458 | ASN1_OBJECT *encalg = NULL; | ||
| 459 | |||
| 460 | if (p2) | ||
| 461 | CMS_RecipientInfo_ktri_get0_algs(p2, NULL, | ||
| 462 | NULL, &alg); | ||
| 463 | if (alg) | ||
| 464 | X509_ALGOR_get0(&encalg, NULL, NULL, alg); | ||
| 465 | if (encalg && OBJ_obj2nid(encalg) == NID_rsaesOaep) | ||
| 466 | rctx->pad_mode = RSA_PKCS1_OAEP_PADDING; | ||
| 467 | } | ||
| 468 | /* FALLTHROUGH */ | ||
| 469 | |||
| 470 | case EVP_PKEY_CTRL_CMS_ENCRYPT: | ||
| 471 | case EVP_PKEY_CTRL_CMS_SIGN: | ||
| 472 | return 1; | ||
| 473 | #endif | ||
| 474 | case EVP_PKEY_CTRL_PEER_KEY: | 451 | case EVP_PKEY_CTRL_PEER_KEY: |
| 475 | RSAerr(RSA_F_PKEY_RSA_CTRL, | 452 | RSAerr(RSA_F_PKEY_RSA_CTRL, |
| 476 | RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); | 453 | RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); |
