We should validate for all of those then :-)


On Wed, Feb 5, 2014 at 11:07 AM, Alex Stapleton <notifications@github.com>wrote:

> In cryptography/hazmat/primitives/asymmetric/rsa.py:
>
> > +        return x.bit_length()
> > +    except AttributeError:
> > +        return len(bin(x)) - (2 + (x <= 0))
> > +
> > +
> > +@utils.register_interface(interfaces.RSAPublicKey)
> > +class RSAPublicKey(object):
> > +    def __init__(self, public_exponent, modulus):
> > +        if (
> > +            not isinstance(public_exponent, six.integer_types) or
> > +            not isinstance(modulus, six.integer_types)
> > +        ):
> > +            raise TypeError("RSAPublicKey arguments must be integers")
> > +
> > +        self._public_exponent = public_exponent
> > +        self._modulus = modulus
>
> modulus >= 2, exponent >= 3 and <= modulus - 1
>
> Is about as strict as PKCS#1 gets I think.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/559/files#r9473341>
> .
>



-- 
"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