1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 14:22:05 +01: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 committed by Paul Schaub
parent f6c6b9aded
commit 8c6813ce56

View file

@ -461,7 +461,7 @@ public abstract class SignatureValidator {
if (!valid) {
throw new SignatureValidationException("Signature is not correct.");
}
} catch (PGPException e) {
} catch (PGPException | ClassCastException e) {
throw new SignatureValidationException("Cannot verify subkey binding signature correctness", e);
}
}
@ -485,7 +485,7 @@ public abstract class SignatureValidator {
if (!valid) {
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);
}
}
@ -514,7 +514,7 @@ public abstract class SignatureValidator {
if (!valid) {
throw new SignatureValidationException("Signature is not correct.");
}
} catch (PGPException e) {
} catch (PGPException | ClassCastException e) {
throw new SignatureValidationException("Cannot verify direct-key signature correctness", e);
}
}
@ -577,7 +577,7 @@ public abstract class SignatureValidator {
if (!valid) {
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);
}
}
@ -602,7 +602,7 @@ public abstract class SignatureValidator {
if (!valid) {
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);
}
}