From 89d47907f112be41a9ea4e684af24d5a74c14336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 27 Feb 2016 15:09:06 +0100 Subject: Make _padding and _check_padding abstractmethod --- src/cryptography/hazmat/primitives/padding.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/primitives/padding.py b/src/cryptography/hazmat/primitives/padding.py index 81883404..c6fe656e 100644 --- a/src/cryptography/hazmat/primitives/padding.py +++ b/src/cryptography/hazmat/primitives/padding.py @@ -39,6 +39,7 @@ class _BytePadding(object): self.block_size = block_size +@six.add_metaclass(abc.ABCMeta) class _BytePaddingContext(object): def __init__(self, block_size): self.block_size = block_size @@ -61,8 +62,11 @@ class _BytePaddingContext(object): return result + @abc.abstractmethod def _padding(self, size): - return NotImplemented + """ + Returns the padding for the size. + """ def finalize(self): if self._buffer is None: @@ -74,6 +78,7 @@ class _BytePaddingContext(object): return result +@six.add_metaclass(abc.ABCMeta) class _ByteUnpaddingContext(object): def __init__(self, block_size): self.block_size = block_size @@ -99,8 +104,11 @@ class _ByteUnpaddingContext(object): return result + @abc.abstractmethod def _check_padding(self): - return NotImplemented + """ + Returns if the padding is valid. + """ def finalize(self): if self._buffer is None: -- cgit v1.2.3