<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 11 Nov 2020 at 14:14, Nicola Tuveri <<a href="mailto:nic.tuv@gmail.com">nic.tuv@gmail.com</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"><br>
In particular in 1.1.1, the key created as depicted in #12612 that<br>
triggered this discussion (Matt posted a useful reproducer among the<br>
first comments), is indeed capable of signing in the used pattern, but<br>
the pattern is conveniently omitting the validation pass that should<br>
be required in any serious use of the API.<br></blockquote><div><br></div><div>The private key is a random or pseudo-random 256-bit integer.</div><div>How do you propose to "validate" that?</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
`EVP_PKEY_check()`<br>
(<a href="https://www.openssl.org/docs/man1.1.1/man3/EVP_PKEY_check.html" rel="noreferrer" target="_blank">https://www.openssl.org/docs/man1.1.1/man3/EVP_PKEY_check.html</a>) is<br>
one of the many places in 1.1.1 where both the documentation and the<br>
behavior assume that an `EVP_PKEY` object is a keypair.<br>
Even in the version used by the user that posted the issue, running<br>
`EVP_PKEY_check()` on the created key would have revealed that the<br>
user was abusing the API.<br></blockquote><div><br></div><div> I was not "abusing the API" as you put it, merely pointing out that the public key is not a required item for performing ECDSA signature generation.  This is a mathematical fact of life that you are going to have to learn to live with.<br></div><div><br></div><div><br></div><div></div><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
>8<br>
<br>
Omitting the `EVP_PKEY_check()` in the reproducer and the user<br>
application, would for example allow me to write a DoS attack: the<br>
secret scalar could easily be hand-picked to trigger an endless loop<br>
in the sign operation.<br></blockquote><div><br></div><div>Nonsense.  Each iteration involves a new PRN, which by definition you cannot predict.</div><div><br></div><div><br></div><div>--RWF</div><div><br></div></div></div>