File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
main/java/com/ibm/plugin/rules/detection/jca/keyspec
test/java/com/ibm/plugin/rules/detection/jca Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 2222import static com .ibm .plugin .rules .detection .TypeShortcuts .BYTE_ARRAY_TYPE ;
2323import static com .ibm .plugin .rules .detection .TypeShortcuts .CHAR_ARRAY_TYPE ;
2424
25+ import com .ibm .engine .model .Size ;
2526import com .ibm .engine .model .context .KeyContext ;
2627import com .ibm .engine .model .context .SecretKeyContext ;
2728import com .ibm .engine .model .factory .KeySizeFactory ;
@@ -72,7 +73,7 @@ public final class JcaPBEKeySpec {
7273 .shouldBeDetectedAs (new SaltSizeFactory <>())
7374 .withMethodParameter ("int" )
7475 .withMethodParameter ("int" )
75- .shouldBeDetectedAs (new KeySizeFactory <>())
76+ .shouldBeDetectedAs (new KeySizeFactory <>(Size . UnitType . BIT ))
7677 .buildForContext (new SecretKeyContext (KeyContext .Kind .PBE ))
7778 .inBundle (() -> "Jca" )
7879 .withoutDependingDetectionRules ();
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ public void asserts(
110110
111111 IValue <Tree > value2_1_1 = store_1_1 .getDetectionValues ().get (2 );
112112 assertThat (value2_1_1 ).isInstanceOf (KeySize .class );
113- assertThat (value2_1_1 .asString ()).isEqualTo ("2048 " );
113+ assertThat (value2_1_1 .asString ()).isEqualTo ("256 " );
114114
115115 /*
116116 * Translation
@@ -200,7 +200,7 @@ public void asserts(
200200 INode keyLengthNode = secretKeyNode .getChildren ().get (KeyLength .class );
201201 assertThat (keyLengthNode ).isNotNull ();
202202 assertThat (keyLengthNode .getChildren ()).isEmpty ();
203- assertThat (keyLengthNode .asString ()).isEqualTo ("2048 " );
203+ assertThat (keyLengthNode .asString ()).isEqualTo ("256 " );
204204 } else if (findingId == 1 ) {
205205 /*
206206 * Detection Store
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public void asserts(
9090 .anyMatch (
9191 v -> {
9292 if (v instanceof KeySize <Tree >) {
93- return v .asString ().equals ("1024 " );
93+ return v .asString ().equals ("128 " );
9494 } else if (v instanceof SaltSize <Tree >) {
9595 return v .asString ().equals ("192" );
9696 } else if (v instanceof PasswordSize <Tree >) {
@@ -114,7 +114,7 @@ public void asserts(
114114 INode keyLengthNode = secretKeyNode .getChildren ().get (KeyLength .class );
115115 assertThat (keyLengthNode ).isNotNull ();
116116 assertThat (keyLengthNode .getChildren ()).isEmpty ();
117- assertThat (keyLengthNode .asString ()).isEqualTo ("1024 " );
117+ assertThat (keyLengthNode .asString ()).isEqualTo ("128 " );
118118
119119 // PasswordBasedKeyDerivationFunction under SecretKey
120120 INode passwordBasedKeyDerivationFunctionNode =
You can’t perform that action at this time.
0 commit comments