Awesome... In any event, it still shouldn't be an assertion error, I guess
it needs to be a generic DecryptionFailure though


On Fri, Nov 22, 2013 at 11:34 AM, Paul Kehrer <notifications@github.com>wrote:

> In tests/hazmat/primitives/utils.py:
>
> > +        pytest.skip(skip_message)
> > +    if params.get("pt") is not None:
> > +        plaintext = params.pop("pt")
> > +    ciphertext = params.pop("ct")
> > +    aad = params.pop("aad")
> > +    if params.get("fail") is True:
> > +        cipher = Cipher(
> > +            cipher_factory(binascii.unhexlify(params["key"])),
> > +            mode_factory(binascii.unhexlify(params["iv"]),
> > +                         binascii.unhexlify(params["tag"])),
> > +            backend
> > +        )
> > +        decryptor = cipher.decryptor()
> > +        decryptor.add_data(binascii.unhexlify(aad))
> > +        actual_plaintext = decryptor.update(binascii.unhexlify(ciphertext))
> > +        with pytest.raises(AssertionError):
>
> Not that I've been able to find. When calling ERR_get_error during tag
> verify failure you get 0L back, which is the same you get for no error. The
> GCM example code that OpenSSL has in their tree (
> https://github.com/openssl/openssl/blob/master/demos/evp/aesgcm.c) just
> checks that the return value of the function is > 0. Frustrating.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/176/files#r7866423>
> .
>



-- 
"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