summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/smime.c
diff options
context:
space:
mode:
authortb <>2023-04-14 15:27:13 +0000
committertb <>2023-04-14 15:27:13 +0000
commit1a5bd4cb78097710de5283a737286c1b65609dc7 (patch)
tree7aed66c51404da4ea67dbb87b6191ab6c0e9a5ee /src/usr.bin/openssl/smime.c
parentbe3f11b57177567c1f951c5428261d6d8d9ee729 (diff)
downloadopenbsd-1a5bd4cb78097710de5283a737286c1b65609dc7.tar.gz
openbsd-1a5bd4cb78097710de5283a737286c1b65609dc7.tar.bz2
openbsd-1a5bd4cb78097710de5283a737286c1b65609dc7.zip
Drop policy printing from openssl
Nothing really uses the policy tree. It's desgined with built-in DoS capabilities directly from the RFC. It will be removed from the attack surface and replaced with something equivalent that doesn't grow exponentially with the depth. This removes the only reason the policy tree itself ever leaked out of the library. ok jsing
Diffstat (limited to 'src/usr.bin/openssl/smime.c')
-rw-r--r--src/usr.bin/openssl/smime.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/usr.bin/openssl/smime.c b/src/usr.bin/openssl/smime.c
index e54c8d0b84..46bfa08679 100644
--- a/src/usr.bin/openssl/smime.c
+++ b/src/usr.bin/openssl/smime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: smime.c,v 1.19 2023/03/06 14:32:06 tb Exp $ */ 1/* $OpenBSD: smime.c,v 1.20 2023/04/14 15:27:13 tb 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 */
@@ -70,7 +70,6 @@
70#include <openssl/x509v3.h> 70#include <openssl/x509v3.h>
71 71
72static int save_certs(char *signerfile, STACK_OF(X509) *signers); 72static int save_certs(char *signerfile, STACK_OF(X509) *signers);
73static int smime_cb(int ok, X509_STORE_CTX *ctx);
74 73
75#define SMIME_OP 0x10 74#define SMIME_OP 0x10
76#define SMIME_IP 0x20 75#define SMIME_IP 0x20
@@ -933,7 +932,6 @@ smime_main(int argc, char **argv)
933 if ((store = setup_verify(bio_err, cfg.CAfile, 932 if ((store = setup_verify(bio_err, cfg.CAfile,
934 cfg.CApath)) == NULL) 933 cfg.CApath)) == NULL)
935 goto end; 934 goto end;
936 X509_STORE_set_verify_cb(store, smime_cb);
937 if (cfg.vpm != NULL) { 935 if (cfg.vpm != NULL) {
938 if (!X509_STORE_set1_param(store, cfg.vpm)) 936 if (!X509_STORE_set1_param(store, cfg.vpm))
939 goto end; 937 goto end;
@@ -1103,20 +1101,3 @@ save_certs(char *signerfile, STACK_OF(X509) *signers)
1103 1101
1104 return 1; 1102 return 1;
1105} 1103}
1106
1107/* Minimal callback just to output policy info (if any) */
1108static int
1109smime_cb(int ok, X509_STORE_CTX *ctx)
1110{
1111 int error;
1112
1113 error = X509_STORE_CTX_get_error(ctx);
1114
1115 if ((error != X509_V_ERR_NO_EXPLICIT_POLICY) &&
1116 ((error != X509_V_OK) || (ok != 2)))
1117 return ok;
1118
1119 policies_print(NULL, ctx);
1120
1121 return ok;
1122}