Hang as in infinite loop, or hang as in, just really slow?


On Tue, May 27, 2014 at 4:09 PM, Paul Kehrer <notifications@github.com>wrote:

> In tests/hazmat/backends/test_openssl.py:
>
> > @@ -277,6 +277,22 @@ def test_generate_rsa_parameters_supported(self):
> >          assert backend.generate_rsa_parameters_supported(3, 1024) is True
> >          assert backend.generate_rsa_parameters_supported(3, 511) is False
> >
> > +    def test_generate_bad_public_exponent(self):
> > +        with pytest.raises(ValueError):
> > +            backend.generate_rsa_private_key(public_exponent=1, key_size=2048)
> > +
> > +        with pytest.raises(ValueError):
> > +            backend.generate_rsa_private_key(public_exponent=4, key_size=2048)
> > +
> > +    def test_cant_generate_insecure_tiny_key(self):
> > +        with pytest.raises(ValueError):
> > +            backend.generate_rsa_private_key(public_exponent=65537,
> > +                                             key_size=511)
> > +
> > +        with pytest.raises(ValueError):
> > +            backend.generate_rsa_private_key(public_exponent=65537,
> > +                                             key_size=256)
>
> There is some ultra-minimum bit length (in the 20s?) below which it will
> crash. It will also crash on any even public exponent. It will also hang
> forever on huge key sizes, so we may want to consider adding a check there?)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/1082/files#r13102640>
> .
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084