<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 14 Mar 2022 at 11:03, 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">On Mon, 2022-03-14 at 08:58 -0300, Richard Dymond wrote:<br>> By the way, the reason I need to get the 'r' and 's' values from the<br>
> DSA signature is that I am encoding them one after the other as 160-<br>
> bit unsigned integers, in network byte order, as required by SSH and<br>
> described in section 6.6 of RFC 4253 (dss_signature_blob)[1]. To do<br>
> this encoding I am calling BN_bn2bin() twice to write 'r' followed by<br>
> 's' at the appropriate locations in a 40-byte buffer. By any chance,<br>
> does OpenSSL 3.0 provide any support for encoding a DSA signature<br>
> like this from a DSA_SIG (i.e. without having to extract 'r' and 's'<br>
> first and then use BN_bn2bin())?<br>
<br>
No, there is no such function. However there is not much overhead in<br>
doing the two BN_bn2bin calls (should those be BN_bn2binpad actually?)<br>
once you already have a DSA_SIG object.<br></blockquote><div><br></div><div style="font-size:small" class="gmail_default">OK, I suppose that was hoping for too much. But thanks for the tip regarding BN_bn2binpad v. BN_bn2bin - that does simplify the code a little more.</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">Richard<br></div></div></div>