[openssl-dev] Retrieving DSA public key (Y) in ASN.1 format

Philip Prindeville philipp_subx at redfish-solutions.com
Wed Dec 17 18:29:39 UTC 2014


On Dec 16, 2014, at 4:14 PM, Dave Thompson <dthompson at prinpay.com> wrote:

>> [DSAPublicKey] defined where you would expect, in dsa/dsa_asn1.c .
>> But it's defined as a "choice" that does either the standard INTEGER
>> (from internal BIGNUM) *OR* the above SEQUENCE which is named
>> 'dsa_pub_internal' suggesting that it should be internal to OpenSSL
>> i.e. not interoperable or standard, but not explained that I can find.
>> 
>> Anyway, to get the standard form apparently you need to set
>> dsa->write_params to 0 (false) which is done *for the SPKI form*
>> in dsa_ameth.c dsa_pub_encode.
>> 
> Argh! Too obvious! It's in the manpage for i2d_DSAPublicKey
> although IMO slightly overstated; the 0 format is standard AFAICT.


Okay, so why does DSA_new_method() set write_params to 1?

-Philip



More information about the openssl-dev mailing list