summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2014-04-18 14:32:23 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2014-04-18 14:32:23 +0000
commitd2f46196d57492ee3b1f4f16bdbdc1dc2230d266 (patch)
tree92de36c332c1037349557edd01cb8a259c07d6a3 /usr.sbin/relayd
parent668e887acd275e2c0535e0613c1e08b106cbb82a (diff)
The RSA_FLAG_SIGN_VER is not yet supported and the current code uses
the rsa_priv_enc() and rsa_pub_dec() callbacks for sign and verify operations. A tale from OpenSSL's rsa.h: New sign and verify functions: some libraries don't allow arbitrary data to be signed/verified: this allows them to be used. Note: for this to work the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used RSA_sign(), RSA_verify() should be used instead. Note: for backwards compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER option is set in 'flags'. In OpenSSL, RSA engines should provide the rsa_sign() and rsa_verify() callbacks and this should be the default. By the "default" is disabled by default and RSA engines that provide extra sign and verify callbacks have to set the non-default RSA_FLAG_SIGN_VER flag. This is not used by OpenSSL's own RSA code and was only set by two non-default RSA engines: IBM 4758 and Windows CAPI - both of them got removed from our library. And btw., this comment about the new non-default default was added in 1999. Thanks to Piotr Sikora, who pointed out that I didn't handle the sign/verify case.
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/ca.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/relayd/ca.c b/usr.sbin/relayd/ca.c
index c08a64d4de7..4804d8e4c89 100644
--- a/usr.sbin/relayd/ca.c
+++ b/usr.sbin/relayd/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.1 2014/04/18 13:55:26 reyk Exp $ */
+/* $OpenBSD: ca.c,v 1.2 2014/04/18 14:32:22 reyk Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -411,6 +411,9 @@ ca_engine_init(struct relayd *x_env)
(rsa_default = ENGINE_get_RSA(e)) == NULL)
return (-1);
+ if (rsa_default->flags & RSA_FLAG_SIGN_VER)
+ fatalx("unsupported RSA engine");
+
if (rsa_default->rsa_mod_exp == NULL)
rsae_method.rsa_mod_exp = NULL;
if (rsa_default->rsa_mod_exp == NULL)