summaryrefslogtreecommitdiffstats
path: root/crypto/dsa
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-04-12 17:01:19 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-04-12 17:01:19 +0000
commit0cb8499b73ec37cf1bcbd0d394375534b5e553a4 (patch)
tree9a5e3c4fff6200fc900c3cd824f16e5af7c51645 /crypto/dsa
parent4d62ec32e0b73f56dc8030584af8efe4ecb3d2f9 (diff)
Compare parameters when comparing public keys.
Diffstat (limited to 'crypto/dsa')
-rw-r--r--crypto/dsa/dsa_ameth.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c
index 73fba10602..ce5e657463 100644
--- a/crypto/dsa/dsa_ameth.c
+++ b/crypto/dsa/dsa_ameth.c
@@ -167,14 +167,6 @@ static int dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
return 0;
}
-static int dsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
- {
- if (BN_cmp(b->pkey.dsa->pub_key,a->pkey.dsa->pub_key) != 0)
- return 0;
- else
- return 1;
- }
-
/* In PKCS#8 DSA: you just get a private key integer and parameters in the
* AlgorithmIdentifier the pubkey must be recalculated.
*/
@@ -389,6 +381,16 @@ static int dsa_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)
return 1;
}
+static int dsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
+ {
+ if (dsa_cmp_parameters(a, b) == 0)
+ return 0;
+ if (BN_cmp(b->pkey.dsa->pub_key,a->pkey.dsa->pub_key) != 0)
+ return 0;
+ else
+ return 1;
+ }
+
static void int_dsa_free(EVP_PKEY *pkey)
{
DSA_free(pkey->pkey.dsa);