Implement ssl{,_ctx}_security()
authortb <tb@openbsd.org>
Tue, 28 Jun 2022 20:44:49 +0000 (20:44 +0000)
committertb <tb@openbsd.org>
Tue, 28 Jun 2022 20:44:49 +0000 (20:44 +0000)
ok beck jsing sthen

lib/libssl/ssl_seclevel.c

index 3da78c6..d86d38e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ssl_seclevel.c,v 1.1 2022/06/28 20:40:24 tb Exp $ */
+/*     $OpenBSD: ssl_seclevel.c,v 1.2 2022/06/28 20:44:49 tb Exp $ */
 /*
  * Copyright (c) 2020 Theo Buehler <tb@openbsd.org>
  *
@@ -192,3 +192,17 @@ ssl_security_dummy_cb(const SSL *ssl, const SSL_CTX *ctx, int op, int bits,
 {
        return 1;
 }
+
+int
+ssl_ctx_security(const SSL_CTX *ctx, int op, int bits, int nid, void *other)
+{
+       return ctx->internal->cert->security_cb(NULL, ctx, op, bits, nid, other,
+           ctx->internal->cert->security_ex_data);
+}
+
+int
+ssl_security(const SSL *ssl, int op, int bits, int nid, void *other)
+{
+       return ssl->cert->security_cb(ssl, NULL, op, bits, nid, other,
+           ssl->cert->security_ex_data);
+}