<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 14 Mar 2022 at 04:52, Tomas Mraz <<a href="mailto:tomas@openssl.org">tomas@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The DSA_SIG_* functions are not deprecated including the i2d and d2i<br>
functions. So you can use d2i_DSA_SIG to decode the DER produced by the<br>
EVP_DigestSign() and then obtain the r and s values from the DSA_SIG.<br></blockquote><div><br></div><div><div><div style="font-size:small" class="gmail_default">Thank you, that works! For some reason it had escaped my notice that the DSA_SIG_* functions are not deprecated.</div></div><div><br></div><div><div style="font-size:small" class="gmail_default">By
 the way, the reason I need to get the 'r' and 's' values from the DSA 
signature is that I am encoding them one after the other as 160-bit 
unsigned integers, in network byte order, as required by SSH and 
described in section 6.6 of RFC 4253 (dss_signature_blob)[1]. To do this
 encoding I am calling BN_bn2bin() twice to write 'r' followed by 's' at
 the appropriate locations in a 40-byte buffer. By any chance, does 
OpenSSL 3.0 provide any support for encoding a DSA signature like this 
from a DSA_SIG (i.e. without having to extract 'r' and 's' first and 
then use BN_bn2bin())?</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">Richard</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">[1] <a href="https://datatracker.ietf.org/doc/html/rfc4253#section-6.6" target="_blank">https://datatracker.ietf.org/doc/html/rfc4253#section-6.6</a></div></div> </div></div></div>