-/* $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)
*
{
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:
-/* $OpenBSD: signature.c,v 1.28 2022/01/11 12:14:07 tb Exp $ */
+/* $OpenBSD: signature.c,v 1.29 2022/01/14 09:08:03 tb Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
*
case KEYNOTE_ALGORITHM_DSA:
p1 = (DSA *) key1;
p2 = (DSA *) key2;
- if (!BN_cmp(p1->p, p2->p) &&
- !BN_cmp(p1->q, p2->q) &&
- !BN_cmp(p1->g, p2->g) &&
- !BN_cmp(p1->pub_key, p2->pub_key))
+ if (!BN_cmp(DSA_get0_p(p1), DSA_get0_p(p2)) &&
+ !BN_cmp(DSA_get0_q(p1), DSA_get0_q(p2)) &&
+ !BN_cmp(DSA_get0_g(p1), DSA_get0_g(p2)) &&
+ !BN_cmp(DSA_get0_pub_key(p1), DSA_get0_pub_key(p2)))
return RESULT_TRUE;
else
return RESULT_FALSE;
case KEYNOTE_ALGORITHM_X509:
p3 = (RSA *) key1;
p4 = (RSA *) key2;
- if (!BN_cmp(p3->n, p4->n) &&
- !BN_cmp(p3->e, p4->e))
+ if (!BN_cmp(RSA_get0_n(p3), RSA_get0_n(p4)) &&
+ !BN_cmp(RSA_get0_e(p3), RSA_get0_e(p4)))
return RESULT_TRUE;
else
return RESULT_FALSE;
case KEYNOTE_ALGORITHM_RSA:
p3 = (RSA *) key1;
p4 = (RSA *) key2;
- if (!BN_cmp(p3->n, p4->n) &&
- !BN_cmp(p3->e, p4->e))
+ if (!BN_cmp(RSA_get0_n(p3), RSA_get0_n(p4)) &&
+ !BN_cmp(RSA_get0_e(p3), RSA_get0_e(p4)))
return RESULT_TRUE;
else
return RESULT_FALSE;