summaryrefslogtreecommitdiff
path: root/lib/libssl/ssl_rsa.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-06-29 21:16:31 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-06-29 21:16:31 +0000
commit3c5afb5f0242bdec6ae0defc8ab8ffe1380003e1 (patch)
tree152af1763ad7d7103296cdbde9ee8e93a9179415 /lib/libssl/ssl_rsa.c
parent26099b59dd7800ab32ee55d91ad135b48b048b35 (diff)
Add a security check to ssl_set_cert()
ok beck jsing
Diffstat (limited to 'lib/libssl/ssl_rsa.c')
-rw-r--r--lib/libssl/ssl_rsa.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libssl/ssl_rsa.c b/lib/libssl/ssl_rsa.c
index 11edb6f76ee..11296d3baa7 100644
--- a/lib/libssl/ssl_rsa.c
+++ b/lib/libssl/ssl_rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_rsa.c,v 1.41 2022/06/29 21:13:34 tb Exp $ */
+/* $OpenBSD: ssl_rsa.c,v 1.42 2022/06/29 21:16:30 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -364,8 +364,14 @@ ssl_set_cert(SSL_CTX *ctx, SSL *ssl, X509 *x)
{
SSL_CERT *c;
EVP_PKEY *pkey;
+ int ssl_err;
int i;
+ if (!ssl_security_cert(ctx, ssl, x, 1, &ssl_err)) {
+ SSLerrorx(ssl_err);
+ return (0);
+ }
+
if ((c = ssl_get0_cert(ctx, ssl)) == NULL)
return (0);