@@ -255,7 +255,7 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
255
255
final RubyString str = readInitArg (context , arg );
256
256
final String strJava = str .toString ();
257
257
258
- if ( isCurveName (strJava ) ) {
258
+ if (! strJava . isEmpty () && isCurveName (strJava )) {
259
259
this .curveName = strJava ;
260
260
return this ;
261
261
}
@@ -311,22 +311,6 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
311
311
else debugStackTrace (runtime , e );
312
312
}
313
313
}
314
- // if ( key == null && ! noClassDef ) {
315
- // try { // readECParameters
316
- // ASN1ObjectIdentifier oid = ASN1ObjectIdentifier.getInstance(str.getBytes());
317
- // ECNamedCurveParameterSpec paramSpec = ECNamedCurveTable.getParameterSpec(oid.getId());
318
- //
319
- // // ecdsaFactory.generatePublic(keySpec)
320
- //
321
- // }
322
- // catch (NoClassDefFoundError e) { noClassDef = true; debugStackTrace(runtime, e); }
323
- // catch (InvalidKeySpecException e) { debug(runtime, "PKeyEC could not read public key", e); }
324
- // catch (IOException e) { debug(runtime, "PKeyEC could not read public key", e); }
325
- // catch (RuntimeException e) {
326
- // if ( isKeyGenerationFailure(e) ) debug(runtime, "PKeyEC could not read public key", e);
327
- // else debugStackTrace(runtime, e);
328
- // }
329
- // }
330
314
331
315
if ( key == null ) key = tryPKCS8EncodedKey (runtime , ecdsaFactory , str .getBytes ());
332
316
if ( key == null ) key = tryX509EncodedKey (runtime , ecdsaFactory , str .getBytes ());
0 commit comments