I thin the `assert reason is not None` means they also won't slip though?


On Sat, Apr 19, 2014 at 10:29 AM, Paul Kehrer <notifications@github.com>wrote:

> In cryptography/hazmat/backends/openssl/backend.py:
>
> > @@ -842,9 +842,19 @@ def _finalize_pkey_ctx(self, evp_pkey, pkey_size, evp_md):
> >              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. Try using "
> > -                             "MAX_LENGTH instead.")
> > +                    self._backend._lib.RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE or
> > +                    errors[0].reason ==
> > +                    self._backend._lib.RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY)
>
> The only purpose is to make sure if any other error bleeds through it will
> fail while preserving 100% coverage.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/840/files#r11794716>
> .
>



-- 
"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