diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/src/apps/ca.c | 2 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/ciphers.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/cms.c | 80 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/crl.c | 27 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/crl2p7.c | 9 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/s_cb.c | 6 |
6 files changed, 74 insertions, 56 deletions
diff --git a/src/lib/libssl/src/apps/ca.c b/src/lib/libssl/src/apps/ca.c index de858d5a55..ccd522571e 100644 --- a/src/lib/libssl/src/apps/ca.c +++ b/src/lib/libssl/src/apps/ca.c | |||
| @@ -2125,7 +2125,7 @@ certify_spkac(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, | |||
| 2125 | ri = req->req_info; | 2125 | ri = req->req_info; |
| 2126 | n = ri->subject; | 2126 | n = ri->subject; |
| 2127 | 2127 | ||
| 2128 | for (i = 0; ; i++) { | 2128 | for (i = 0;; i++) { |
| 2129 | if (sk_CONF_VALUE_num(sk) <= i) | 2129 | if (sk_CONF_VALUE_num(sk) <= i) |
| 2130 | break; | 2130 | break; |
| 2131 | 2131 | ||
diff --git a/src/lib/libssl/src/apps/ciphers.c b/src/lib/libssl/src/apps/ciphers.c index d7ee87aa26..ef2da82507 100644 --- a/src/lib/libssl/src/apps/ciphers.c +++ b/src/lib/libssl/src/apps/ciphers.c | |||
| @@ -149,7 +149,7 @@ ciphers_main(int argc, char **argv) | |||
| 149 | 149 | ||
| 150 | 150 | ||
| 151 | if (!verbose) { | 151 | if (!verbose) { |
| 152 | for (i = 0;; i++) { | 152 | for (i = 0; ; i++) { |
| 153 | p = SSL_get_cipher_list(ssl, i); | 153 | p = SSL_get_cipher_list(ssl, i); |
| 154 | if (p == NULL) | 154 | if (p == NULL) |
| 155 | break; | 155 | break; |
| @@ -180,7 +180,8 @@ ciphers_main(int argc, char **argv) | |||
| 180 | else | 180 | else |
| 181 | BIO_printf(STDout, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0, id1, id2, id3); /* whatever */ | 181 | BIO_printf(STDout, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0, id1, id2, id3); /* whatever */ |
| 182 | } | 182 | } |
| 183 | BIO_puts(STDout, SSL_CIPHER_description(c, buf, sizeof buf)); | 183 | BIO_puts(STDout, |
| 184 | SSL_CIPHER_description(c, buf, sizeof buf)); | ||
| 184 | } | 185 | } |
| 185 | } | 186 | } |
| 186 | 187 | ||
| @@ -190,6 +191,7 @@ err: | |||
| 190 | SSL_load_error_strings(); | 191 | SSL_load_error_strings(); |
| 191 | ERR_print_errors(bio_err); | 192 | ERR_print_errors(bio_err); |
| 192 | } | 193 | } |
| 194 | |||
| 193 | end: | 195 | end: |
| 194 | if (ctx != NULL) | 196 | if (ctx != NULL) |
| 195 | SSL_CTX_free(ctx); | 197 | SSL_CTX_free(ctx); |
diff --git a/src/lib/libssl/src/apps/cms.c b/src/lib/libssl/src/apps/cms.c index 0ece401ce3..8828a243c2 100644 --- a/src/lib/libssl/src/apps/cms.c +++ b/src/lib/libssl/src/apps/cms.c | |||
| @@ -69,9 +69,8 @@ | |||
| 69 | static int save_certs(char *signerfile, STACK_OF(X509) * signers); | 69 | static int save_certs(char *signerfile, STACK_OF(X509) * signers); |
| 70 | static int cms_cb(int ok, X509_STORE_CTX * ctx); | 70 | static int cms_cb(int ok, X509_STORE_CTX * ctx); |
| 71 | static void receipt_request_print(BIO * out, CMS_ContentInfo * cms); | 71 | static void receipt_request_print(BIO * out, CMS_ContentInfo * cms); |
| 72 | static CMS_ReceiptRequest * | 72 | static CMS_ReceiptRequest * make_receipt_request( |
| 73 | make_receipt_request(STACK_OF(OPENSSL_STRING) * rr_to, | 73 | STACK_OF(OPENSSL_STRING) * rr_to, int rr_allorfirst, |
| 74 | int rr_allorfirst, | ||
| 75 | STACK_OF(OPENSSL_STRING) * rr_from); | 74 | STACK_OF(OPENSSL_STRING) * rr_from); |
| 76 | 75 | ||
| 77 | #define SMIME_OP 0x10 | 76 | #define SMIME_OP 0x10 |
| @@ -361,7 +360,8 @@ cms_main(int argc, char **argv) | |||
| 361 | 360 | ||
| 362 | if (signerfile) { | 361 | if (signerfile) { |
| 363 | if (!sksigners) | 362 | if (!sksigners) |
| 364 | sksigners = sk_OPENSSL_STRING_new_null(); | 363 | sksigners = |
| 364 | sk_OPENSSL_STRING_new_null(); | ||
| 365 | sk_OPENSSL_STRING_push(sksigners, signerfile); | 365 | sk_OPENSSL_STRING_push(sksigners, signerfile); |
| 366 | if (!keyfile) | 366 | if (!keyfile) |
| 367 | keyfile = signerfile; | 367 | keyfile = signerfile; |
| @@ -394,11 +394,13 @@ cms_main(int argc, char **argv) | |||
| 394 | /* If previous -inkey arument add signer to list */ | 394 | /* If previous -inkey arument add signer to list */ |
| 395 | if (keyfile) { | 395 | if (keyfile) { |
| 396 | if (!signerfile) { | 396 | if (!signerfile) { |
| 397 | BIO_puts(bio_err, "Illegal -inkey without -signer\n"); | 397 | BIO_puts(bio_err, |
| 398 | "Illegal -inkey without -signer\n"); | ||
| 398 | goto argerr; | 399 | goto argerr; |
| 399 | } | 400 | } |
| 400 | if (!sksigners) | 401 | if (!sksigners) |
| 401 | sksigners = sk_OPENSSL_STRING_new_null(); | 402 | sksigners = |
| 403 | sk_OPENSSL_STRING_new_null(); | ||
| 402 | sk_OPENSSL_STRING_push(sksigners, signerfile); | 404 | sk_OPENSSL_STRING_push(sksigners, signerfile); |
| 403 | signerfile = NULL; | 405 | signerfile = NULL; |
| 404 | if (!skkeys) | 406 | if (!skkeys) |
| @@ -482,19 +484,22 @@ cms_main(int argc, char **argv) | |||
| 482 | sk_OPENSSL_STRING_push(skkeys, keyfile); | 484 | sk_OPENSSL_STRING_push(skkeys, keyfile); |
| 483 | } | 485 | } |
| 484 | if (!sksigners) { | 486 | if (!sksigners) { |
| 485 | BIO_printf(bio_err, "No signer certificate specified\n"); | 487 | BIO_printf(bio_err, |
| 488 | "No signer certificate specified\n"); | ||
| 486 | badarg = 1; | 489 | badarg = 1; |
| 487 | } | 490 | } |
| 488 | signerfile = NULL; | 491 | signerfile = NULL; |
| 489 | keyfile = NULL; | 492 | keyfile = NULL; |
| 490 | } else if (operation == SMIME_DECRYPT) { | 493 | } else if (operation == SMIME_DECRYPT) { |
| 491 | if (!recipfile && !keyfile && !secret_key && !pwri_pass) { | 494 | if (!recipfile && !keyfile && !secret_key && !pwri_pass) { |
| 492 | BIO_printf(bio_err, "No recipient certificate or key specified\n"); | 495 | BIO_printf(bio_err, |
| 496 | "No recipient certificate or key specified\n"); | ||
| 493 | badarg = 1; | 497 | badarg = 1; |
| 494 | } | 498 | } |
| 495 | } else if (operation == SMIME_ENCRYPT) { | 499 | } else if (operation == SMIME_ENCRYPT) { |
| 496 | if (!*args && !secret_key && !pwri_pass) { | 500 | if (!*args && !secret_key && !pwri_pass) { |
| 497 | BIO_printf(bio_err, "No recipient(s) certificate(s) specified\n"); | 501 | BIO_printf(bio_err, |
| 502 | "No recipient(s) certificate(s) specified\n"); | ||
| 498 | badarg = 1; | 503 | badarg = 1; |
| 499 | } | 504 | } |
| 500 | } else if (!operation) | 505 | } else if (!operation) |
| @@ -612,7 +617,7 @@ argerr: | |||
| 612 | encerts = sk_X509_new_null(); | 617 | encerts = sk_X509_new_null(); |
| 613 | while (*args) { | 618 | while (*args) { |
| 614 | if (!(cert = load_cert(bio_err, *args, FORMAT_PEM, | 619 | if (!(cert = load_cert(bio_err, *args, FORMAT_PEM, |
| 615 | NULL, e, "recipient certificate file"))) | 620 | NULL, e, "recipient certificate file"))) |
| 616 | goto end; | 621 | goto end; |
| 617 | sk_X509_push(encerts, cert); | 622 | sk_X509_push(encerts, cert); |
| 618 | cert = NULL; | 623 | cert = NULL; |
| @@ -621,21 +626,21 @@ argerr: | |||
| 621 | } | 626 | } |
| 622 | if (certfile) { | 627 | if (certfile) { |
| 623 | if (!(other = load_certs(bio_err, certfile, FORMAT_PEM, NULL, | 628 | if (!(other = load_certs(bio_err, certfile, FORMAT_PEM, NULL, |
| 624 | e, "certificate file"))) { | 629 | e, "certificate file"))) { |
| 625 | ERR_print_errors(bio_err); | 630 | ERR_print_errors(bio_err); |
| 626 | goto end; | 631 | goto end; |
| 627 | } | 632 | } |
| 628 | } | 633 | } |
| 629 | if (recipfile && (operation == SMIME_DECRYPT)) { | 634 | if (recipfile && (operation == SMIME_DECRYPT)) { |
| 630 | if (!(recip = load_cert(bio_err, recipfile, FORMAT_PEM, NULL, | 635 | if (!(recip = load_cert(bio_err, recipfile, FORMAT_PEM, NULL, |
| 631 | e, "recipient certificate file"))) { | 636 | e, "recipient certificate file"))) { |
| 632 | ERR_print_errors(bio_err); | 637 | ERR_print_errors(bio_err); |
| 633 | goto end; | 638 | goto end; |
| 634 | } | 639 | } |
| 635 | } | 640 | } |
| 636 | if (operation == SMIME_SIGN_RECEIPT) { | 641 | if (operation == SMIME_SIGN_RECEIPT) { |
| 637 | if (!(signer = load_cert(bio_err, signerfile, FORMAT_PEM, NULL, | 642 | if (!(signer = load_cert(bio_err, signerfile, FORMAT_PEM, NULL, |
| 638 | e, "receipt signer certificate file"))) { | 643 | e, "receipt signer certificate file"))) { |
| 639 | ERR_print_errors(bio_err); | 644 | ERR_print_errors(bio_err); |
| 640 | goto end; | 645 | goto end; |
| 641 | } | 646 | } |
| @@ -643,7 +648,8 @@ argerr: | |||
| 643 | if (operation == SMIME_DECRYPT) { | 648 | if (operation == SMIME_DECRYPT) { |
| 644 | if (!keyfile) | 649 | if (!keyfile) |
| 645 | keyfile = recipfile; | 650 | keyfile = recipfile; |
| 646 | } else if ((operation == SMIME_SIGN) || (operation == SMIME_SIGN_RECEIPT)) { | 651 | } else if ((operation == SMIME_SIGN) || |
| 652 | (operation == SMIME_SIGN_RECEIPT)) { | ||
| 647 | if (!keyfile) | 653 | if (!keyfile) |
| 648 | keyfile = signerfile; | 654 | keyfile = signerfile; |
| 649 | } else | 655 | } else |
| @@ -683,7 +689,8 @@ argerr: | |||
| 683 | if (contfile) { | 689 | if (contfile) { |
| 684 | BIO_free(indata); | 690 | BIO_free(indata); |
| 685 | if (!(indata = BIO_new_file(contfile, "rb"))) { | 691 | if (!(indata = BIO_new_file(contfile, "rb"))) { |
| 686 | BIO_printf(bio_err, "Can't read content file %s\n", contfile); | 692 | BIO_printf(bio_err, |
| 693 | "Can't read content file %s\n", contfile); | ||
| 687 | goto end; | 694 | goto end; |
| 688 | } | 695 | } |
| 689 | } | 696 | } |
| @@ -733,7 +740,8 @@ argerr: | |||
| 733 | out = BIO_new_fp(stdout, BIO_NOCLOSE); | 740 | out = BIO_new_fp(stdout, BIO_NOCLOSE); |
| 734 | } | 741 | } |
| 735 | 742 | ||
| 736 | if ((operation == SMIME_VERIFY) || (operation == SMIME_VERIFY_RECEIPT)) { | 743 | if ((operation == SMIME_VERIFY) || |
| 744 | (operation == SMIME_VERIFY_RECEIPT)) { | ||
| 737 | if (!(store = setup_verify(bio_err, CAfile, CApath))) | 745 | if (!(store = setup_verify(bio_err, CAfile, CApath))) |
| 738 | goto end; | 746 | goto end; |
| 739 | X509_STORE_set_verify_cb(store, cms_cb); | 747 | X509_STORE_set_verify_cb(store, cms_cb); |
| @@ -754,22 +762,21 @@ argerr: | |||
| 754 | if (!cms) | 762 | if (!cms) |
| 755 | goto end; | 763 | goto end; |
| 756 | if (secret_key) { | 764 | if (secret_key) { |
| 757 | if (!CMS_add0_recipient_key(cms, NID_undef, | 765 | if (!CMS_add0_recipient_key(cms, NID_undef, secret_key, |
| 758 | secret_key, secret_keylen, | 766 | secret_keylen, secret_keyid, secret_keyidlen, |
| 759 | secret_keyid, secret_keyidlen, | 767 | NULL, NULL, NULL)) |
| 760 | NULL, NULL, NULL)) | ||
| 761 | goto end; | 768 | goto end; |
| 762 | /* NULL these because call absorbs them */ | 769 | /* NULL these because call absorbs them */ |
| 763 | secret_key = NULL; | 770 | secret_key = NULL; |
| 764 | secret_keyid = NULL; | 771 | secret_keyid = NULL; |
| 765 | } | 772 | } |
| 766 | if (pwri_pass) { | 773 | if (pwri_pass) { |
| 767 | pwri_tmp = (unsigned char *) BUF_strdup((char *) pwri_pass); | 774 | pwri_tmp = |
| 775 | (unsigned char *)BUF_strdup((char *)pwri_pass); | ||
| 768 | if (!pwri_tmp) | 776 | if (!pwri_tmp) |
| 769 | goto end; | 777 | goto end; |
| 770 | if (!CMS_add0_recipient_password(cms, | 778 | if (!CMS_add0_recipient_password(cms, -1, NID_undef, |
| 771 | -1, NID_undef, NID_undef, | 779 | NID_undef, pwri_tmp, -1, NULL)) |
| 772 | pwri_tmp, -1, NULL)) | ||
| 773 | goto end; | 780 | goto end; |
| 774 | pwri_tmp = NULL; | 781 | pwri_tmp = NULL; |
| 775 | } | 782 | } |
| @@ -778,9 +785,8 @@ argerr: | |||
| 778 | goto end; | 785 | goto end; |
| 779 | } | 786 | } |
| 780 | } else if (operation == SMIME_ENCRYPTED_ENCRYPT) { | 787 | } else if (operation == SMIME_ENCRYPTED_ENCRYPT) { |
| 781 | cms = CMS_EncryptedData_encrypt(in, cipher, | 788 | cms = CMS_EncryptedData_encrypt(in, cipher, secret_key, |
| 782 | secret_key, secret_keylen, | 789 | secret_keylen, flags); |
| 783 | flags); | ||
| 784 | 790 | ||
| 785 | } else if (operation == SMIME_SIGN_RECEIPT) { | 791 | } else if (operation == SMIME_SIGN_RECEIPT) { |
| 786 | CMS_ContentInfo *srcms = NULL; | 792 | CMS_ContentInfo *srcms = NULL; |
| @@ -829,8 +835,8 @@ argerr: | |||
| 829 | CMS_SignerInfo *si; | 835 | CMS_SignerInfo *si; |
| 830 | signerfile = sk_OPENSSL_STRING_value(sksigners, i); | 836 | signerfile = sk_OPENSSL_STRING_value(sksigners, i); |
| 831 | keyfile = sk_OPENSSL_STRING_value(skkeys, i); | 837 | keyfile = sk_OPENSSL_STRING_value(skkeys, i); |
| 832 | signer = load_cert(bio_err, signerfile, FORMAT_PEM, NULL, | 838 | signer = load_cert(bio_err, signerfile, FORMAT_PEM, |
| 833 | e, "signer certificate"); | 839 | NULL, e, "signer certificate"); |
| 834 | if (!signer) | 840 | if (!signer) |
| 835 | goto end; | 841 | goto end; |
| 836 | key = load_key(bio_err, keyfile, keyform, 0, passin, e, | 842 | key = load_key(bio_err, keyfile, keyform, 0, passin, e, |
| @@ -863,9 +869,8 @@ argerr: | |||
| 863 | CMS_decrypt(cms, NULL, NULL, NULL, NULL, flags); | 869 | CMS_decrypt(cms, NULL, NULL, NULL, NULL, flags); |
| 864 | 870 | ||
| 865 | if (secret_key) { | 871 | if (secret_key) { |
| 866 | if (!CMS_decrypt_set1_key(cms, | 872 | if (!CMS_decrypt_set1_key(cms, secret_key, |
| 867 | secret_key, secret_keylen, | 873 | secret_keylen, secret_keyid, secret_keyidlen)) { |
| 868 | secret_keyid, secret_keyidlen)) { | ||
| 869 | BIO_puts(bio_err, | 874 | BIO_puts(bio_err, |
| 870 | "Error decrypting CMS using secret key\n"); | 875 | "Error decrypting CMS using secret key\n"); |
| 871 | goto end; | 876 | goto end; |
| @@ -904,7 +909,7 @@ argerr: | |||
| 904 | } | 909 | } |
| 905 | } else if (operation == SMIME_ENCRYPTED_DECRYPT) { | 910 | } else if (operation == SMIME_ENCRYPTED_DECRYPT) { |
| 906 | if (!CMS_EncryptedData_decrypt(cms, secret_key, secret_keylen, | 911 | if (!CMS_EncryptedData_decrypt(cms, secret_key, secret_keylen, |
| 907 | indata, out, flags)) | 912 | indata, out, flags)) |
| 908 | goto end; | 913 | goto end; |
| 909 | } else if (operation == SMIME_VERIFY) { | 914 | } else if (operation == SMIME_VERIFY) { |
| 910 | if (CMS_verify(cms, other, store, indata, out, flags) > 0) | 915 | if (CMS_verify(cms, other, store, indata, out, flags) > 0) |
| @@ -966,6 +971,7 @@ argerr: | |||
| 966 | } | 971 | } |
| 967 | } | 972 | } |
| 968 | ret = 0; | 973 | ret = 0; |
| 974 | |||
| 969 | end: | 975 | end: |
| 970 | if (ret) | 976 | if (ret) |
| 971 | ERR_print_errors(bio_err); | 977 | ERR_print_errors(bio_err); |
| @@ -1012,6 +1018,7 @@ save_certs(char *signerfile, STACK_OF(X509) * signers) | |||
| 1012 | { | 1018 | { |
| 1013 | int i; | 1019 | int i; |
| 1014 | BIO *tmp; | 1020 | BIO *tmp; |
| 1021 | |||
| 1015 | if (!signerfile) | 1022 | if (!signerfile) |
| 1016 | return 1; | 1023 | return 1; |
| 1017 | tmp = BIO_new_file(signerfile, "w"); | 1024 | tmp = BIO_new_file(signerfile, "w"); |
| @@ -1023,7 +1030,6 @@ save_certs(char *signerfile, STACK_OF(X509) * signers) | |||
| 1023 | return 1; | 1030 | return 1; |
| 1024 | } | 1031 | } |
| 1025 | 1032 | ||
| 1026 | |||
| 1027 | /* Minimal callback just to output policy info (if any) */ | 1033 | /* Minimal callback just to output policy info (if any) */ |
| 1028 | 1034 | ||
| 1029 | static int | 1035 | static int |
| @@ -1050,6 +1056,7 @@ gnames_stack_print(BIO * out, STACK_OF(GENERAL_NAMES) * gns) | |||
| 1050 | STACK_OF(GENERAL_NAME) * gens; | 1056 | STACK_OF(GENERAL_NAME) * gens; |
| 1051 | GENERAL_NAME *gen; | 1057 | GENERAL_NAME *gen; |
| 1052 | int i, j; | 1058 | int i, j; |
| 1059 | |||
| 1053 | for (i = 0; i < sk_GENERAL_NAMES_num(gns); i++) { | 1060 | for (i = 0; i < sk_GENERAL_NAMES_num(gns); i++) { |
| 1054 | gens = sk_GENERAL_NAMES_value(gns, i); | 1061 | gens = sk_GENERAL_NAMES_value(gns, i); |
| 1055 | for (j = 0; j < sk_GENERAL_NAME_num(gens); j++) { | 1062 | for (j = 0; j < sk_GENERAL_NAME_num(gens); j++) { |
| @@ -1072,6 +1079,7 @@ receipt_request_print(BIO * out, CMS_ContentInfo * cms) | |||
| 1072 | STACK_OF(GENERAL_NAMES) * rto, *rlist; | 1079 | STACK_OF(GENERAL_NAMES) * rto, *rlist; |
| 1073 | ASN1_STRING *scid; | 1080 | ASN1_STRING *scid; |
| 1074 | int i, rv; | 1081 | int i, rv; |
| 1082 | |||
| 1075 | sis = CMS_get0_SignerInfos(cms); | 1083 | sis = CMS_get0_SignerInfos(cms); |
| 1076 | for (i = 0; i < sk_CMS_SignerInfo_num(sis); i++) { | 1084 | for (i = 0; i < sk_CMS_SignerInfo_num(sis); i++) { |
| 1077 | si = sk_CMS_SignerInfo_value(sis, i); | 1085 | si = sk_CMS_SignerInfo_value(sis, i); |
| @@ -1109,8 +1117,7 @@ receipt_request_print(BIO * out, CMS_ContentInfo * cms) | |||
| 1109 | } | 1117 | } |
| 1110 | } | 1118 | } |
| 1111 | 1119 | ||
| 1112 | static | 1120 | static STACK_OF(GENERAL_NAMES) * |
| 1113 | STACK_OF(GENERAL_NAMES) * | ||
| 1114 | make_names_stack(STACK_OF(OPENSSL_STRING) * ns) | 1121 | make_names_stack(STACK_OF(OPENSSL_STRING) * ns) |
| 1115 | { | 1122 | { |
| 1116 | int i; | 1123 | int i; |
| @@ -1155,6 +1162,7 @@ make_receipt_request(STACK_OF(OPENSSL_STRING) * rr_to, int rr_allorfirst, | |||
| 1155 | { | 1162 | { |
| 1156 | STACK_OF(GENERAL_NAMES) * rct_to, *rct_from; | 1163 | STACK_OF(GENERAL_NAMES) * rct_to, *rct_from; |
| 1157 | CMS_ReceiptRequest *rr; | 1164 | CMS_ReceiptRequest *rr; |
| 1165 | |||
| 1158 | rct_to = make_names_stack(rr_to); | 1166 | rct_to = make_names_stack(rr_to); |
| 1159 | if (!rct_to) | 1167 | if (!rct_to) |
| 1160 | goto err; | 1168 | goto err; |
diff --git a/src/lib/libssl/src/apps/crl.c b/src/lib/libssl/src/apps/crl.c index 07fb1fbcdc..60ce43df22 100644 --- a/src/lib/libssl/src/apps/crl.c +++ b/src/lib/libssl/src/apps/crl.c | |||
| @@ -110,7 +110,7 @@ crl_main(int argc, char **argv) | |||
| 110 | int informat, outformat; | 110 | int informat, outformat; |
| 111 | char *infile = NULL, *outfile = NULL; | 111 | char *infile = NULL, *outfile = NULL; |
| 112 | int hash = 0, issuer = 0, lastupdate = 0, nextupdate = 0, noout = 0, | 112 | int hash = 0, issuer = 0, lastupdate = 0, nextupdate = 0, noout = 0, |
| 113 | text = 0; | 113 | text = 0; |
| 114 | #ifndef OPENSSL_NO_MD5 | 114 | #ifndef OPENSSL_NO_MD5 |
| 115 | int hash_old = 0; | 115 | int hash_old = 0; |
| 116 | #endif | 116 | #endif |
| @@ -235,13 +235,15 @@ bad: | |||
| 235 | if (lookup == NULL) | 235 | if (lookup == NULL) |
| 236 | goto end; | 236 | goto end; |
| 237 | if (!X509_LOOKUP_load_file(lookup, CAfile, X509_FILETYPE_PEM)) | 237 | if (!X509_LOOKUP_load_file(lookup, CAfile, X509_FILETYPE_PEM)) |
| 238 | X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_DEFAULT); | 238 | X509_LOOKUP_load_file(lookup, NULL, |
| 239 | X509_FILETYPE_DEFAULT); | ||
| 239 | 240 | ||
| 240 | lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir()); | 241 | lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir()); |
| 241 | if (lookup == NULL) | 242 | if (lookup == NULL) |
| 242 | goto end; | 243 | goto end; |
| 243 | if (!X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM)) | 244 | if (!X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM)) |
| 244 | X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT); | 245 | X509_LOOKUP_add_dir(lookup, NULL, |
| 246 | X509_FILETYPE_DEFAULT); | ||
| 245 | ERR_clear_error(); | 247 | ERR_clear_error(); |
| 246 | 248 | ||
| 247 | if (!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) { | 249 | if (!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) { |
| @@ -275,12 +277,13 @@ bad: | |||
| 275 | if (num) { | 277 | if (num) { |
| 276 | for (i = 1; i <= num; i++) { | 278 | for (i = 1; i <= num; i++) { |
| 277 | if (issuer == i) { | 279 | if (issuer == i) { |
| 278 | print_name(bio_out, "issuer=", X509_CRL_get_issuer(x), nmflag); | 280 | print_name(bio_out, "issuer=", |
| 281 | X509_CRL_get_issuer(x), nmflag); | ||
| 279 | } | 282 | } |
| 280 | if (crlnumber == i) { | 283 | if (crlnumber == i) { |
| 281 | ASN1_INTEGER *crlnum; | 284 | ASN1_INTEGER *crlnum; |
| 282 | crlnum = X509_CRL_get_ext_d2i(x, NID_crl_number, | 285 | crlnum = X509_CRL_get_ext_d2i(x, |
| 283 | NULL, NULL); | 286 | NID_crl_number, NULL, NULL); |
| 284 | BIO_printf(bio_out, "crlNumber="); | 287 | BIO_printf(bio_out, "crlNumber="); |
| 285 | if (crlnum) { | 288 | if (crlnum) { |
| 286 | i2a_ASN1_INTEGER(bio_out, crlnum); | 289 | i2a_ASN1_INTEGER(bio_out, crlnum); |
| @@ -296,8 +299,7 @@ bad: | |||
| 296 | #ifndef OPENSSL_NO_MD5 | 299 | #ifndef OPENSSL_NO_MD5 |
| 297 | if (hash_old == i) { | 300 | if (hash_old == i) { |
| 298 | BIO_printf(bio_out, "%08lx\n", | 301 | BIO_printf(bio_out, "%08lx\n", |
| 299 | X509_NAME_hash_old( | 302 | X509_NAME_hash_old(X509_CRL_get_issuer(x))); |
| 300 | X509_CRL_get_issuer(x))); | ||
| 301 | } | 303 | } |
| 302 | #endif | 304 | #endif |
| 303 | if (lastupdate == i) { | 305 | if (lastupdate == i) { |
| @@ -328,7 +330,7 @@ bad: | |||
| 328 | OBJ_nid2sn(EVP_MD_type(digest))); | 330 | OBJ_nid2sn(EVP_MD_type(digest))); |
| 329 | for (j = 0; j < (int) n; j++) { | 331 | for (j = 0; j < (int) n; j++) { |
| 330 | BIO_printf(bio_out, "%02X%c", md[j], | 332 | BIO_printf(bio_out, "%02X%c", md[j], |
| 331 | (j + 1 == (int) n) ? '\n' : ':'); | 333 | (j + 1 == (int)n) ? '\n' : ':'); |
| 332 | } | 334 | } |
| 333 | } | 335 | } |
| 334 | } | 336 | } |
| @@ -359,7 +361,8 @@ bad: | |||
| 359 | else if (outformat == FORMAT_PEM) | 361 | else if (outformat == FORMAT_PEM) |
| 360 | i = PEM_write_bio_X509_CRL(out, x); | 362 | i = PEM_write_bio_X509_CRL(out, x); |
| 361 | else { | 363 | else { |
| 362 | BIO_printf(bio_err, "bad output format specified for outfile\n"); | 364 | BIO_printf(bio_err, |
| 365 | "bad output format specified for outfile\n"); | ||
| 363 | goto end; | 366 | goto end; |
| 364 | } | 367 | } |
| 365 | if (!i) { | 368 | if (!i) { |
| @@ -405,7 +408,8 @@ load_crl(char *infile, int format) | |||
| 405 | else if (format == FORMAT_PEM) | 408 | else if (format == FORMAT_PEM) |
| 406 | x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); | 409 | x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); |
| 407 | else { | 410 | else { |
| 408 | BIO_printf(bio_err, "bad input format specified for input crl\n"); | 411 | BIO_printf(bio_err, |
| 412 | "bad input format specified for input crl\n"); | ||
| 409 | goto end; | 413 | goto end; |
| 410 | } | 414 | } |
| 411 | if (x == NULL) { | 415 | if (x == NULL) { |
| @@ -413,6 +417,7 @@ load_crl(char *infile, int format) | |||
| 413 | ERR_print_errors(bio_err); | 417 | ERR_print_errors(bio_err); |
| 414 | goto end; | 418 | goto end; |
| 415 | } | 419 | } |
| 420 | |||
| 416 | end: | 421 | end: |
| 417 | BIO_free(in); | 422 | BIO_free(in); |
| 418 | return (x); | 423 | return (x); |
diff --git a/src/lib/libssl/src/apps/crl2p7.c b/src/lib/libssl/src/apps/crl2p7.c index b994c0ce3a..88b4d46a1b 100644 --- a/src/lib/libssl/src/apps/crl2p7.c +++ b/src/lib/libssl/src/apps/crl2p7.c | |||
| @@ -181,7 +181,8 @@ bad: | |||
| 181 | else if (informat == FORMAT_PEM) | 181 | else if (informat == FORMAT_PEM) |
| 182 | crl = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); | 182 | crl = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); |
| 183 | else { | 183 | else { |
| 184 | BIO_printf(bio_err, "bad input format specified for input crl\n"); | 184 | BIO_printf(bio_err, |
| 185 | "bad input format specified for input crl\n"); | ||
| 185 | goto end; | 186 | goto end; |
| 186 | } | 187 | } |
| 187 | if (crl == NULL) { | 188 | if (crl == NULL) { |
| @@ -215,7 +216,8 @@ bad: | |||
| 215 | for (i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) { | 216 | for (i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) { |
| 216 | certfile = sk_OPENSSL_STRING_value(certflst, i); | 217 | certfile = sk_OPENSSL_STRING_value(certflst, i); |
| 217 | if (add_certs_from_file(cert_stack, certfile) < 0) { | 218 | if (add_certs_from_file(cert_stack, certfile) < 0) { |
| 218 | BIO_printf(bio_err, "error loading certificates\n"); | 219 | BIO_printf(bio_err, |
| 220 | "error loading certificates\n"); | ||
| 219 | ERR_print_errors(bio_err); | 221 | ERR_print_errors(bio_err); |
| 220 | goto end; | 222 | goto end; |
| 221 | } | 223 | } |
| @@ -237,7 +239,8 @@ bad: | |||
| 237 | else if (outformat == FORMAT_PEM) | 239 | else if (outformat == FORMAT_PEM) |
| 238 | i = PEM_write_bio_PKCS7(out, p7); | 240 | i = PEM_write_bio_PKCS7(out, p7); |
| 239 | else { | 241 | else { |
| 240 | BIO_printf(bio_err, "bad output format specified for outfile\n"); | 242 | BIO_printf(bio_err, |
| 243 | "bad output format specified for outfile\n"); | ||
| 241 | goto end; | 244 | goto end; |
| 242 | } | 245 | } |
| 243 | if (!i) { | 246 | if (!i) { |
diff --git a/src/lib/libssl/src/apps/s_cb.c b/src/lib/libssl/src/apps/s_cb.c index 38ea2714a8..362339c787 100644 --- a/src/lib/libssl/src/apps/s_cb.c +++ b/src/lib/libssl/src/apps/s_cb.c | |||
| @@ -201,7 +201,7 @@ set_cert_stuff(SSL_CTX * ctx, char *cert_file, char *key_file) | |||
| 201 | */ | 201 | */ |
| 202 | 202 | ||
| 203 | if (SSL_CTX_use_certificate_file(ctx, cert_file, | 203 | if (SSL_CTX_use_certificate_file(ctx, cert_file, |
| 204 | SSL_FILETYPE_PEM) <= 0) { | 204 | SSL_FILETYPE_PEM) <= 0) { |
| 205 | BIO_printf(bio_err, | 205 | BIO_printf(bio_err, |
| 206 | "unable to get certificate from '%s'\n", cert_file); | 206 | "unable to get certificate from '%s'\n", cert_file); |
| 207 | ERR_print_errors(bio_err); | 207 | ERR_print_errors(bio_err); |
| @@ -210,7 +210,7 @@ set_cert_stuff(SSL_CTX * ctx, char *cert_file, char *key_file) | |||
| 210 | if (key_file == NULL) | 210 | if (key_file == NULL) |
| 211 | key_file = cert_file; | 211 | key_file = cert_file; |
| 212 | if (SSL_CTX_use_PrivateKey_file(ctx, key_file, | 212 | if (SSL_CTX_use_PrivateKey_file(ctx, key_file, |
| 213 | SSL_FILETYPE_PEM) <= 0) { | 213 | SSL_FILETYPE_PEM) <= 0) { |
| 214 | BIO_printf(bio_err, | 214 | BIO_printf(bio_err, |
| 215 | "unable to get private key from '%s'\n", key_file); | 215 | "unable to get private key from '%s'\n", key_file); |
| 216 | ERR_print_errors(bio_err); | 216 | ERR_print_errors(bio_err); |
| @@ -341,7 +341,7 @@ msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, | |||
| 341 | { | 341 | { |
| 342 | BIO *bio = arg; | 342 | BIO *bio = arg; |
| 343 | const char *str_write_p, *str_version, *str_content_type = "", | 343 | const char *str_write_p, *str_version, *str_content_type = "", |
| 344 | *str_details1 = "", *str_details2 = ""; | 344 | *str_details1 = "", *str_details2 = ""; |
| 345 | 345 | ||
| 346 | str_write_p = write_p ? ">>>" : "<<<"; | 346 | str_write_p = write_p ? ">>>" : "<<<"; |
| 347 | 347 | ||
