Oh, yeah of course.


On Fri, Nov 22, 2013 at 4:57 PM, Donald Stufft <notifications@github.com>wrote:

> In cryptography/hazmat/bindings/openssl/backend.py:
>
> > @@ -193,6 +193,27 @@ def create_symmetric_encryption_ctx(self, cipher, mode):
> >      def create_symmetric_decryption_ctx(self, cipher, mode):
> >          return _CipherContext(self, cipher, mode, _CipherContext._DECRYPT)
> >
> > +    def _handle_error(self):
> > +        code = self.lib.ERR_get_error()
> > +        assert code != 0
> > +        lib = self.lib.ERR_GET_LIB(code)
> > +        func = self.lib.ERR_GET_FUNC(code)
> > +        reason = self.lib.ERR_GET_REASON(code)
> > +        return self._handle_error_code(lib, func, reason)
> > +
> > +    def _handle_error_code(self, lib, func, reason):
> > +        if lib == self.lib.ERR_LIB_EVP:
> > +            if func == self.lib.EVP_F_EVP_ENCRYPTFINAL_EX:
> > +                if reason == self.lib.EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH:
> > +                    raise ValueError
>
> Can we include a message with this ValueError that just says something
> like "Data is not a multiple of block length"?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/274/files#r7873649>
> .
>



-- 
"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