Skip to contentSkip to conversation

Release 0.4.1 as a minor bugfix

PATCH New Konstantin Ryabitsev 1 participant 3 messages May 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Release 0.4.1 as a minor bugfix

From: Konstantin Ryabitsev <[email protected]>

This returns better errors on brand new installs, so is worth a minor dot release.

---
 patatt/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
patatt/__init__.py +1 -1
index 1101d7f..8365a4d 100644
@@ -47,7 +47,7 @@ OPT_HDRS = [b'message-id']
 KEYCACHE = dict()
 
 # My version
-__VERSION__ = '0.4.0'
+__VERSION__ = '0.4.1'
 MAX_SUPPORTED_FORMAT_VERSION = 1
 
 
Signature · 1 line
2.31.1
#1 lore raw

PATCH 2/3 Perform bh validation first

From: Konstantin Ryabitsev <[email protected]>

Instead of doing bh validation as the last step, do it at the very start. This way we can recognize body content modifications early on before needing to do any signature validation at all.

---
 patatt/__init__.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
patatt/__init__.py +4 -3
index 8365a4d..042a747 100644
@@ -188,6 +188,10 @@ class DevsigHeader:
 
     def validate(self, keyinfo: Union[str, bytes, None]) -> str:
         self.sanity_check()
+        # Start by validating the body hash. If it fails to match, we can
+        # bail early, before needing to do any signature validation.
+        if self.get_field('bh') != self._body_hash:
+            raise BodyValidationError('Body content validation failed')
         # Check that we have a b= field
         if not self.get_field('b'):
             raise RuntimeError('Missing "b=" value')
@@ -214,9 +218,6 @@ class DevsigHeader:
         vdigest = hashed.digest()
         if sdigest != vdigest:
             raise ValidationError('Header validation failed')
-        # Now validate body hash
-        if self.get_field('bh') != self._body_hash:
-            raise BodyValidationError('Body content validation failed')
 
         return signtime
 
Signature · 1 line
2.31.1
#2 lore raw

PATCH 3/3 Bump version to 0.4.2

In reply to Konstantin Ryabitsev

From: Konstantin Ryabitsev <[email protected]>

Preparing for b4 0.7.0 release.

---
 patatt/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
patatt/__init__.py +1 -1
index 042a747..15833dc 100644
@@ -47,7 +47,7 @@ OPT_HDRS = [b'message-id']
 KEYCACHE = dict()
 
 # My version
-__VERSION__ = '0.4.1'
+__VERSION__ = '0.4.2'
 MAX_SUPPORTED_FORMAT_VERSION = 1
 
 
Signature · 1 line
2.31.1