@@ -255,7 +255,7 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
255255 final RubyString str = readInitArg (context , arg );
256256 final String strJava = str .toString ();
257257
258- if ( isCurveName (strJava ) ) {
258+ if (! strJava . isEmpty () && isCurveName (strJava )) {
259259 this .curveName = strJava ;
260260 return this ;
261261 }
@@ -311,22 +311,6 @@ public IRubyObject initialize(final ThreadContext context, final IRubyObject[] a
311311 else debugStackTrace (runtime , e );
312312 }
313313 }
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- // }
330314
331315 if ( key == null ) key = tryPKCS8EncodedKey (runtime , ecdsaFactory , str .getBytes ());
332316 if ( key == null ) key = tryX509EncodedKey (runtime , ecdsaFactory , str .getBytes ());
0 commit comments