Skip to content

Commit 9cec468

Browse files
committed
fix(jca): negate KeyManagerFactorySpec init guard to flag UnsafeAlgorithm correctly
The init event raised UnsafeAlgorithm when the algorithm WAS in safeAlgorithms (PKIX/SunX509), inverting the intended check: safe algorithms were flagged while unsafe ones passed. Negate the guard to match every sibling JCA spec (TrustManagerFactorySpec, KeyGeneratorSpec, MacSpec, SignatureSpec, ...) and the already-correct compiled .rvm.
1 parent 84179f0 commit 9cec468

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rvsec/rvsec-mop/src/main/resources/jca/KeyManagerFactorySpec.mop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ KeyManagerFactorySpec(KeyManagerFactory k) {
5050
( call(public void KeyManagerFactory.init(KeyStore, char[])) ||
5151
call(public void KeyManagerFactory.init(ManagerFactoryParameters))
5252
) && target(k) {
53-
if (safeAlgorithms.contains(currentAlgorithmInstance)) {
53+
if (!safeAlgorithms.contains(currentAlgorithmInstance)) {
5454
ErrorCollector.instance().addError(new ErrorDescription(ErrorType.UnsafeAlgorithm, "KeyManagerFactorySpec", "" + __LOC,
5555
" expecting one of " + String.join(",", safeAlgorithms) + " but found " + currentAlgorithmInstance + "."));
5656
}

0 commit comments

Comments
 (0)