commit 6d7c774ba2fd812c587cf948d8f474b34c7c50af
parent 90056dbdcb8be5575a3258da6250e1f969671e52
Author: Joris Vink <joris@coders.se>
Date: Sat, 10 Jul 2021 10:02:53 +0200
remove support for older openssl apis in keymgr.
Diffstat:
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/src/keymgr.c b/src/keymgr.c
@@ -693,12 +693,8 @@ keymgr_rsa_encrypt(struct kore_msg *msg, const void *data, struct key *key)
u_int8_t buf[1024];
req = (const struct kore_keyreq *)data;
-
-#if defined(KORE_OPENSSL_NEWER_API)
rsa = EVP_PKEY_get0_RSA(key->pkey);
-#else
- rsa = key->pkey->pkey.rsa;
-#endif
+
keylen = RSA_size(rsa);
if (req->data_len > keylen || keylen > sizeof(buf))
return;
@@ -721,11 +717,8 @@ keymgr_ecdsa_sign(struct kore_msg *msg, const void *data, struct key *key)
u_int8_t sig[1024];
req = (const struct kore_keyreq *)data;
-#if defined(KORE_OPENSSL_NEWER_API)
ec = EVP_PKEY_get0_EC_KEY(key->pkey);
-#else
- ec = key->pkey->pkey.ec;
-#endif
+
len = ECDSA_size(ec);
if (req->data_len > len || len > sizeof(sig))
return;
@@ -801,14 +794,8 @@ keymgr_acme_init(void)
kore_log(LOG_INFO, "loaded existing ACME account key");
}
-#if defined(KORE_OPENSSL_NEWER_API)
rsa = EVP_PKEY_get0_RSA(key->pkey);
RSA_get0_key(rsa, &bn, &be, NULL);
-#else
- rsa = key->pkey->pkey.rsa;
- be = rsa->e;
- bn = rsa->n;
-#endif
e = keymgr_bignum_base64(be);
n = keymgr_bignum_base64(bn);