<div dir="ltr">Hello Dave,<div><br></div><div>What you said is right. Have checked ecs_ossl.c and implemented similar way to truncate the digest based on the order. </div><div><br></div><div>Now, handshake is successful even for TLS1.2.</div><div><br></div><div>Thanks alot.</div><div><br></div><div>Rajeswari.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 16, 2015 at 11:53 PM, Dave Thompson <span dir="ltr"><<a href="mailto:dthompson@prinpay.com" target="_blank">dthompson@prinpay.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> From: openssl-users On Behalf Of Rajeswari K<br>
</span>> Sent: Friday, February 13, 2015 23:50<br>
<span class="">> Hello Dave,<br>
> Based on your input, have stopped calling i2d_ECDSA_SIG()<br>
> and used BN_bn2bin() to overcome the der headers.<br>
> And now, my verification is working fine.<br>
<br>
</span>ECDSA_verify in ecs_vrf.c only uses i2d to *check* that the<br>
input was canonical, to block certain possible attacks. It's<br>
the d2i that parsed the signature, and the internal form<br>
(ECDSA_SIG structure) is used for the actual verification.<br>
<span class=""><br>
> Is there any function at openssl, to get the HASH used for<br>
> the digest at ECDSA_verify()?<br>
> I see that, for ECDSA_verify(), first argument is type. But<br>
> when its calling the function pointer, ECDSA_verify() is not<br>
> passing the type of the hash.<br>
> So, would like to get the hash type from digest data.<br>
<br>
</span>ECDSA (and DSA) signatures do not care about the hash<br>
algorithm, only the length of the hash *value*. Notice<br>
that ECDSA_verify does not pass type to ECDSA_do_verify,<br>
which does the actual dispatch to a possible engine.<br>
(This differs from RSA, at least PKCS#1 as used by SSL/TLS,<br>
where the hash algorithm identifier is included in padding.)<br>
<span class=""><br>
> I can understand that for TLS1.2, openssl uses SHA512.<br>
> But the same information i would like to get from digest data.<br>
> Is there any way to get this? Please share.<br>
<br>
</span>For the ServerKeyExchange message (the case you said<br>
you cared about) in TLS1.2, it appears OpenSSL server uses<br>
the client's preference as stated in the sigalgs extension,<br>
except in 1.0.2 a new SuiteB option forces SuiteB choices.<br>
If the client offers all current hashes for ECDSA in strength<br>
order, which is very reasonable, SHA512 will be the choice.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</div></div></blockquote></div><br></div>