diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-03-26 14:35:49 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-03-26 22:04:15 +0000 |
commit | ea6b07b54c1f8fc2275a121cdda071e2df7bd6c1 (patch) | |
tree | 1c588d9f06776c8087dd60427a917814d5708109 /crypto/dsa/dsa_asn1.c | |
parent | dd14f911714da77876a3c17e0168b6afef923be8 (diff) | |
download | openssl-ea6b07b54c1f8fc2275a121cdda071e2df7bd6c1.tar.gz |
Simplify DSA public key handling.
DSA public keys could exist in two forms: a single Integer type or a
SEQUENCE containing the parameters and public key with a field called
"write_params" deciding which form to use. These forms are non standard
and were only used by functions containing "DSAPublicKey" in the name.
Simplify code to only use the parameter form and encode the public key
component directly in the DSA public key method.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/dsa/dsa_asn1.c')
-rw-r--r-- | crypto/dsa/dsa_asn1.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crypto/dsa/dsa_asn1.c b/crypto/dsa/dsa_asn1.c index 08ed52ba5d..e7f80a8d62 100644 --- a/crypto/dsa/dsa_asn1.c +++ b/crypto/dsa/dsa_asn1.c @@ -132,17 +132,12 @@ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA, DSAparams, DSAparams) * key as an INTEGER or the parameters and public key in a SEQUENCE */ -ASN1_SEQUENCE(dsa_pub_internal) = { +ASN1_SEQUENCE(DSAPublicKey) = { ASN1_SIMPLE(DSA, pub_key, BIGNUM), ASN1_SIMPLE(DSA, p, BIGNUM), ASN1_SIMPLE(DSA, q, BIGNUM), ASN1_SIMPLE(DSA, g, BIGNUM) -} ASN1_SEQUENCE_END_name(DSA, dsa_pub_internal) - -ASN1_CHOICE_cb(DSAPublicKey, dsa_cb) = { - ASN1_SIMPLE(DSA, pub_key, BIGNUM), - ASN1_EX_COMBINE(0, 0, dsa_pub_internal) -} ASN1_CHOICE_END_cb(DSA, DSAPublicKey, write_params) +} ASN1_SEQUENCE_END_name(DSA, DSAPublicKey) IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA, DSAPublicKey, DSAPublicKey) |