diff options
author | Vitaly Takmazov | 2023-11-22 23:02:24 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-11-22 23:14:07 +0300 |
commit | cbe520ca2bd73a4e281105ca8579645c8786b080 (patch) | |
tree | 08fbf696d5b927ea38a15624d428a87511dc669e | |
parent | 845b57ca5f1c5e7aa5767ca849784eb6ed272507 (diff) |
ActivityPub: handle all exceptions in signature verification
-rw-r--r-- | src/main/java/com/juick/ActivityPubManager.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java index 33cc458b..f234969b 100644 --- a/src/main/java/com/juick/ActivityPubManager.java +++ b/src/main/java/com/juick/ActivityPubManager.java @@ -462,8 +462,8 @@ public class ActivityPubManager implements ActivityListener, NotificationListene } } if (key != null) { - Verifier verifier = new Verifier(key, signature); try { + Verifier verifier = new Verifier(key, signature); boolean result = verifier.verify(method.toLowerCase(), path, headers); if (result) { if (!user.isAnonymous()) { @@ -481,8 +481,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene } } } - } catch (NoSuchAlgorithmException | SignatureException | MissingRequiredHeaderException - | IOException e) { + } catch (Exception e) { logger.warn("Verification error for {}: {}", signature.getKeyId(), e.getMessage()); } } |