Request a smaller salt? I don't think they can get this error for any 
reason other than manually entering a salt length that's too large?


On 20 March 2014 17:47:48 Alex Gaynor <notifications@github.com> wrote:

> > @@ -768,7 +824,13 @@ def _finalize_pkey_ctx(self, evp_pkey, pkey_size, 
> evp_md):
> >          buf = self._backend._ffi.new("unsigned char[]", buflen[0])
> >          res = self._backend._lib.EVP_PKEY_sign(
> >              pkey_ctx, buf, buflen, data_to_sign, len(data_to_sign))
> > -        assert res == 1
> > +        if res != 1:
> > +            errors = self._backend._consume_errors()
> > +            assert errors[0].lib == self._backend._lib.ERR_LIB_RSA
> > +            assert (errors[0].reason ==
> > +                    self._backend._lib.RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE)
> > +            raise ValueError("Salt length too long for key size")
>
> Same thing here, what is the user supposed to do with this info.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/pyca/cryptography/pull/833/files#r10806977