File tree Expand file tree Collapse file tree 4 files changed +41
-5
lines changed
pkix/src/main/java/org/bouncycastle/cms
prov/src/main/java/org/bouncycastle/jcajce/spec Expand file tree Collapse file tree 4 files changed +41
-5
lines changed Original file line number Diff line number Diff line change @@ -194,14 +194,14 @@ public DefaultCMSSignatureAlgorithmNameGenerator()
194194 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_sha2_192s , "SLH-DSA-SHA2-192S" );
195195 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_sha2_192f , "SLH-DSA-SHA2-192F" );
196196 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_sha2_256s , "SLH-DSA-SHA2-256S" );
197- simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_sha2_256s , "SLH-DSA-SHA2-256F" );
197+ simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_sha2_256f , "SLH-DSA-SHA2-256F" );
198198
199199 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_shake_128s , "SLH-DSA-SHAKE-128S" );
200200 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_shake_128f , "SLH-DSA-SHAKE-128F" );
201201 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_shake_192s , "SLH-DSA-SHAKE-192S" );
202202 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_shake_192f , "SLH-DSA-SHAKE-192F" );
203203 simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_shake_256s , "SLH-DSA-SHAKE-256S" );
204- simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_shake_256s , "SLH-DSA-SHAKE-256F" );
204+ simpleAlgs .put (NISTObjectIdentifiers .id_slh_dsa_shake_256f , "SLH-DSA-SHAKE-256F" );
205205
206206 simpleAlgs .put (BCObjectIdentifiers .picnic_signature , "Picnic" );
207207 }
Original file line number Diff line number Diff line change @@ -46,6 +46,18 @@ public String getName()
4646
4747 public static MLDSAParameterSpec fromName (String name )
4848 {
49- return (MLDSAParameterSpec )parameters .get (Strings .toLowerCase (name ));
49+ if (name == null )
50+ {
51+ throw new NullPointerException ("name cannot be null" );
52+ }
53+
54+ MLDSAParameterSpec parameterSpec = (MLDSAParameterSpec )parameters .get (Strings .toLowerCase (name ));
55+
56+ if (parameterSpec == null )
57+ {
58+ throw new IllegalArgumentException ("unknown parameter name: " + name );
59+ }
60+
61+ return parameterSpec ;
5062 }
5163}
Original file line number Diff line number Diff line change @@ -43,6 +43,18 @@ public String getName()
4343
4444 public static MLKEMParameterSpec fromName (String name )
4545 {
46- return (MLKEMParameterSpec )parameters .get (Strings .toLowerCase (name ));
46+ if (name == null )
47+ {
48+ throw new NullPointerException ("name cannot be null" );
49+ }
50+
51+ MLKEMParameterSpec parameterSpec = (MLKEMParameterSpec )parameters .get (Strings .toLowerCase (name ));
52+
53+ if (parameterSpec == null )
54+ {
55+ throw new IllegalArgumentException ("unknown parameter name: " + name );
56+ }
57+
58+ return parameterSpec ;
4759 }
4860}
Original file line number Diff line number Diff line change @@ -128,6 +128,18 @@ public String getName()
128128
129129 public static SLHDSAParameterSpec fromName (String name )
130130 {
131- return (SLHDSAParameterSpec )parameters .get (Strings .toLowerCase (name ));
131+ if (name == null )
132+ {
133+ throw new NullPointerException ("name cannot be null" );
134+ }
135+
136+ SLHDSAParameterSpec parameterSpec = (SLHDSAParameterSpec )parameters .get (Strings .toLowerCase (name ));
137+
138+ if (parameterSpec == null )
139+ {
140+ throw new IllegalArgumentException ("unknown parameter name: " + name );
141+ }
142+
143+ return parameterSpec ;
132144 }
133145}
You can’t perform that action at this time.
0 commit comments