Skip to content

Ghidra is a software reverse engineering (SRE) framework

Reject null signatures in GhidraServer PKI Auth

jro-calif8dfbd0bfc99c
diff --git a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/security/PKIAuthenticationModule.java b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/security/PKIAuthenticationModule.java
index 3e160abb21..a751a28d32 100644
--- a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/security/PKIAuthenticationModule.java
+++ b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/security/PKIAuthenticationModule.java
@@ -141,14 +141,14 @@ public class PKIAuthenticationModule implements AuthenticationModule {
DefaultTrustManagerFactory.validateClient(certChain, PKIUtils.RSA_TYPE);
byte[] sigBytes = sigCb.getSignature();
- if (sigBytes != null) {
-
- Signature sig = Signature.getInstance(certChain[0].getSigAlgName());
- sig.initVerify(certChain[0]);
- sig.update(token);
- if (!sig.verify(sigBytes)) {
- throw new FailedLoginException("Incorrect signature");
- }
+ if (sigBytes == null) {
+ throw new FailedLoginException("Client signature required");
+ }
+ Signature sig = Signature.getInstance(certChain[0].getSigAlgName());
+ sig.initVerify(certChain[0]);
+ sig.update(token);
+ if (!sig.verify(sigBytes)) {
+ throw new FailedLoginException("Incorrect signature");
}
String dnUsername =