diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2022-01-14 09:08:04 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2022-01-14 09:08:04 +0000 |
commit | 8fa8f652be902adfa18b0da6fdf6814a98c1030c (patch) | |
tree | ef2a3f4bc2a5096ccce819517af4e6b4de3a58fb /lib/libkeynote/auxil.c | |
parent | 4d6ca442339b72c640582577ce9072c09a2af2e6 (diff) |
libkeynote: fix build with opaque RSA and DSA
This is a completely mechanical conversion to use accessors instead
of reaching inside the structs by hand.
ok millert
Diffstat (limited to 'lib/libkeynote/auxil.c')
-rw-r--r-- | lib/libkeynote/auxil.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libkeynote/auxil.c b/lib/libkeynote/auxil.c index 3e8e4b4d1aa..64071c2493f 100644 --- a/lib/libkeynote/auxil.c +++ b/lib/libkeynote/auxil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auxil.c,v 1.11 2015/12/14 03:35:40 mmcc Exp $ */ +/* $OpenBSD: auxil.c,v 1.12 2022/01/14 09:08:03 tb Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -53,22 +53,22 @@ keynote_keyhash(void *key, int alg) { case KEYNOTE_ALGORITHM_DSA: dsa = (DSA *) key; - res += BN_mod_word(dsa->p, HASHTABLESIZE); - res += BN_mod_word(dsa->q, HASHTABLESIZE); - res += BN_mod_word(dsa->g, HASHTABLESIZE); - res += BN_mod_word(dsa->pub_key, HASHTABLESIZE); + res += BN_mod_word(DSA_get0_p(dsa), HASHTABLESIZE); + res += BN_mod_word(DSA_get0_q(dsa), HASHTABLESIZE); + res += BN_mod_word(DSA_get0_g(dsa), HASHTABLESIZE); + res += BN_mod_word(DSA_get0_pub_key(dsa), HASHTABLESIZE); return res % HASHTABLESIZE; case KEYNOTE_ALGORITHM_RSA: rsa = (RSA *) key; - res += BN_mod_word(rsa->n, HASHTABLESIZE); - res += BN_mod_word(rsa->e, HASHTABLESIZE); + res += BN_mod_word(RSA_get0_n(rsa), HASHTABLESIZE); + res += BN_mod_word(RSA_get0_e(rsa), HASHTABLESIZE); return res % HASHTABLESIZE; case KEYNOTE_ALGORITHM_X509: /* RSA-specific */ rsa = (RSA *) key; - res += BN_mod_word(rsa->n, HASHTABLESIZE); - res += BN_mod_word(rsa->e, HASHTABLESIZE); + res += BN_mod_word(RSA_get0_n(rsa), HASHTABLESIZE); + res += BN_mod_word(RSA_get0_e(rsa), HASHTABLESIZE); return res % HASHTABLESIZE; case KEYNOTE_ALGORITHM_BINARY: |