summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2019-01-20 23:12:36 +0000
committerDamien Miller <djm@cvs.openbsd.org>2019-01-20 23:12:36 +0000
commit113ca62fb26d595a52c390a1a6d940d17824ac1f (patch)
tree9368a2ae09ed97ce42a26940f3e67630ed4a68be /usr.bin
parent1e7eee12038f3f8862b4286e6d646571fe7ca5b8 (diff)
we use singleton pkcs#11 RSA_METHOD and EC_KEY_METHOD now, so there
is no need to keep a copy of each in the pkcs11_key object. work by markus@, ok djm@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/ssh-pkcs11.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/ssh/ssh-pkcs11.c b/usr.bin/ssh/ssh-pkcs11.c
index 90b94a7e6f1..bfcce0d09e3 100644
--- a/usr.bin/ssh/ssh-pkcs11.c
+++ b/usr.bin/ssh/ssh-pkcs11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11.c,v 1.35 2019/01/20 23:11:11 djm Exp $ */
+/* $OpenBSD: ssh-pkcs11.c,v 1.36 2019/01/20 23:12:35 djm Exp $ */
/*
* Copyright (c) 2010 Markus Friedl. All rights reserved.
* Copyright (c) 2014 Pedro Martelletto. All rights reserved.
@@ -62,8 +62,6 @@ TAILQ_HEAD(, pkcs11_provider) pkcs11_providers;
struct pkcs11_key {
struct pkcs11_provider *provider;
CK_ULONG slotidx;
- RSA_METHOD *rsa_method;
- EC_KEY_METHOD *ec_key_method;
char *keyid;
int keyid_len;
};
@@ -399,8 +397,7 @@ pkcs11_rsa_wrap(struct pkcs11_provider *provider, CK_ULONG slotidx,
memcpy(k11->keyid, keyid_attrib->pValue, k11->keyid_len);
}
- k11->rsa_method = rsa_method;
- RSA_set_method(rsa, k11->rsa_method);
+ RSA_set_method(rsa, rsa_method);
RSA_set_ex_data(rsa, rsa_idx, k11);
return (0);
}
@@ -502,9 +499,8 @@ pkcs11_ecdsa_wrap(struct pkcs11_provider *provider, CK_ULONG slotidx,
k11->keyid_len = keyid_attrib->ulValueLen;
k11->keyid = xmalloc(k11->keyid_len);
memcpy(k11->keyid, keyid_attrib->pValue, k11->keyid_len);
- k11->ec_key_method = ec_key_method;
- EC_KEY_set_method(ec, k11->ec_key_method);
+ EC_KEY_set_method(ec, ec_key_method);
EC_KEY_set_ex_data(ec, ec_key_idx, k11);
return (0);