1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-15 21:29:38 +02:00

#266 Handle ClassCastException in signature.init calls

This commit is contained in:
Péter Barabás 2022-04-05 10:38:19 +02:00
parent 0bce68d6ee
commit cfa560f65c
3 changed files with 15 additions and 7 deletions

8
local.properties Normal file
View file

@ -0,0 +1,8 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Apr 04 22:58:31 CEST 2022
sdk.dir=/Users/pbarabas/Library/Android/sdk

View file

@ -461,7 +461,7 @@ public abstract class SignatureValidator {
if (!valid) { if (!valid) {
throw new SignatureValidationException("Signature is not correct."); throw new SignatureValidationException("Signature is not correct.");
} }
} catch (PGPException e) { } catch (PGPException | ClassCastException e) {
throw new SignatureValidationException("Cannot verify subkey binding signature correctness", e); throw new SignatureValidationException("Cannot verify subkey binding signature correctness", e);
} }
} }
@ -485,7 +485,7 @@ public abstract class SignatureValidator {
if (!valid) { if (!valid) {
throw new SignatureValidationException("Primary Key Binding Signature is not correct."); throw new SignatureValidationException("Primary Key Binding Signature is not correct.");
} }
} catch (PGPException e) { } catch (PGPException | ClassCastException e) {
throw new SignatureValidationException("Cannot verify primary key binding signature correctness", e); throw new SignatureValidationException("Cannot verify primary key binding signature correctness", e);
} }
} }
@ -514,7 +514,7 @@ public abstract class SignatureValidator {
if (!valid) { if (!valid) {
throw new SignatureValidationException("Signature is not correct."); throw new SignatureValidationException("Signature is not correct.");
} }
} catch (PGPException e) { } catch (PGPException | ClassCastException e) {
throw new SignatureValidationException("Cannot verify direct-key signature correctness", e); throw new SignatureValidationException("Cannot verify direct-key signature correctness", e);
} }
} }
@ -577,7 +577,7 @@ public abstract class SignatureValidator {
if (!valid) { if (!valid) {
throw new SignatureValidationException("Signature over user-id '" + userId + "' is not correct."); throw new SignatureValidationException("Signature over user-id '" + userId + "' is not correct.");
} }
} catch (PGPException e) { } catch (PGPException | ClassCastException e) {
throw new SignatureValidationException("Cannot verify signature over user-id '" + userId + "'.", e); throw new SignatureValidationException("Cannot verify signature over user-id '" + userId + "'.", e);
} }
} }
@ -602,7 +602,7 @@ public abstract class SignatureValidator {
if (!valid) { if (!valid) {
throw new SignatureValidationException("Signature over user-attribute vector is not correct."); throw new SignatureValidationException("Signature over user-attribute vector is not correct.");
} }
} catch (PGPException e) { } catch (PGPException | ClassCastException e) {
throw new SignatureValidationException("Cannot verify signature over user-attribute vector.", e); throw new SignatureValidationException("Cannot verify signature over user-attribute vector.", e);
} }
} }

View file

@ -134,7 +134,7 @@ public abstract class SelectUserId {
* Note: This only accepts user-ids which properly have the email address surrounded by angle brackets. * Note: This only accepts user-ids which properly have the email address surrounded by angle brackets.
* *
* The argument <pre>email</pre> can both be a plain email address (<pre>"foo@bar.baz"</pre>), * The argument <pre>email</pre> can both be a plain email address (<pre>"foo@bar.baz"</pre>),
* or surrounded by angle brackets (<pre>"<foo@bar.baz>"</pre>, the result of the filter will be the same. * or surrounded by angle brackets (<pre>"foo@bar.baz"</pre>, the result of the filter will be the same.
* *
* @param email email address * @param email email address
* @return filter * @return filter
@ -181,7 +181,7 @@ public abstract class SelectUserId {
} }
/** /**
* Filter that filters for user-ids which pass at least one of the given <pre>filters</pre>>. * Filter that filters for user-ids which pass at least one of the given <pre>filters</pre>.
* *
* @param filters filters * @param filters filters
* @return filter * @return filter