Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dup was broken for several classes

openssl methods were not defined for branch

git-svn-id: http://svn.codehaus.org/jruby/branches/enebo_block@2845 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
commit 76488695f09273bd23608315b7372e70cd1ec82c 1 parent 667e851
@enebo enebo authored
Showing with 344 additions and 328 deletions.
  1. +1 −1  jruby/src/org/jruby/RubyDigest.java
  2. +1 −1  jruby/src/org/jruby/RubyKernel.java
  3. +1 −1  jruby/src/org/jruby/RubyObject.java
  4. +4 −4 jruby/src/org/jruby/RubyString.java
  5. +34 −34 jruby/src/org/jruby/ext/openssl/ASN1.java
  6. +7 −6 jruby/src/org/jruby/ext/openssl/Attribute.java
  7. +20 −19 jruby/src/org/jruby/ext/openssl/Cipher.java
  8. +1 −1  jruby/src/org/jruby/ext/openssl/Config.java
  9. +14 −14 jruby/src/org/jruby/ext/openssl/Digest.java
  10. +12 −11 jruby/src/org/jruby/ext/openssl/HMAC.java
  11. +12 −11 jruby/src/org/jruby/ext/openssl/NetscapeSPKI.java
  12. +42 −41 jruby/src/org/jruby/ext/openssl/PKCS7.java
  13. +4 −3 jruby/src/org/jruby/ext/openssl/PKey.java
  14. +12 −11 jruby/src/org/jruby/ext/openssl/PKeyDSA.java
  15. +13 −12 jruby/src/org/jruby/ext/openssl/PKeyRSA.java
  16. +7 −7 jruby/src/org/jruby/ext/openssl/Random.java
  17. +20 −19 jruby/src/org/jruby/ext/openssl/Request.java
  18. +4 −3 jruby/src/org/jruby/ext/openssl/SSLContext.java
  19. +13 −12 jruby/src/org/jruby/ext/openssl/SSLSocket.java
  20. +28 −27 jruby/src/org/jruby/ext/openssl/X509CRL.java
  21. +30 −29 jruby/src/org/jruby/ext/openssl/X509Cert.java
  22. +16 −15 jruby/src/org/jruby/ext/openssl/X509Extensions.java
  23. +10 −9 jruby/src/org/jruby/ext/openssl/X509Name.java
  24. +9 −8 jruby/src/org/jruby/ext/openssl/X509Revoked.java
  25. +11 −12 jruby/src/org/jruby/ext/openssl/X509Store.java
  26. +15 −14 jruby/src/org/jruby/ext/openssl/X509StoreCtx.java
  27. +2 −2 jruby/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
  28. +1 −1  jruby/src/org/jruby/runtime/builtin/meta/TimeMetaClass.java
View
2  jruby/src/org/jruby/RubyDigest.java
@@ -50,7 +50,7 @@ public static void createDigest(IRuby runtime) {
cDigestBase.defineFastSingletonMethod("hexdigest",basecb.getFastSingletonMethod("s_hexdigest",IRubyObject.class));
cDigestBase.defineMethod("initialize",basecb.getOptMethod("initialize"));
- cDigestBase.defineMethod("initialize_copy",basecb.getMethod("initialize_copy",IRubyObject.class));
+ cDigestBase.defineFastMethod("initialize_copy",basecb.getFastMethod("initialize_copy",IRubyObject.class));
cDigestBase.defineFastMethod("clone",basecb.getFastMethod("rbClone"));
cDigestBase.defineFastMethod("update",basecb.getFastMethod("update",IRubyObject.class));
cDigestBase.defineFastMethod("<<",basecb.getFastMethod("update",IRubyObject.class));
View
2  jruby/src/org/jruby/RubyKernel.java
@@ -176,7 +176,7 @@ public static RubyModule createKernelModule(IRuby runtime) {
module.defineFastPublicModuleFunction("extend", objectCallbackFactory.getFastOptMethod("extend"));
module.defineFastPublicModuleFunction("freeze", objectCallbackFactory.getFastMethod("freeze"));
module.defineFastPublicModuleFunction("frozen?", objectCallbackFactory.getFastMethod("frozen"));
- module.defineModuleFunction("initialize_copy", objectCallbackFactory.getMethod("initialize_copy", IRubyObject.class));
+ module.defineFastModuleFunction("initialize_copy", objectCallbackFactory.getFastMethod("initialize_copy", IRubyObject.class));
module.definePublicModuleFunction("instance_eval", objectCallbackFactory.getOptMethod("instance_eval"));
module.defineFastPublicModuleFunction("instance_of?", objectCallbackFactory.getFastMethod("instance_of", IRubyObject.class));
module.defineFastPublicModuleFunction("instance_variables", objectCallbackFactory.getFastMethod("instance_variables"));
View
2  jruby/src/org/jruby/RubyObject.java
@@ -806,7 +806,7 @@ public IRubyObject same(IRubyObject other) {
return this == other ? getRuntime().getTrue() : getRuntime().getFalse();
}
- public IRubyObject initialize_copy(IRubyObject original, Block block) {
+ public IRubyObject initialize_copy(IRubyObject original) {
if (this != original) {
checkFrozen();
if (!getClass().equals(original.getClass())) {
View
8 jruby/src/org/jruby/RubyString.java
@@ -396,7 +396,7 @@ public IRubyObject to_str() {
/** rb_str_replace_m
*
*/
- public RubyString replace(IRubyObject other, Block block) {
+ public RubyString replace(IRubyObject other) {
RubyString newValue = stringValue(other);
if (this == other || sameAs(newValue)) {
return this;
@@ -425,9 +425,9 @@ public static RubyString newInstance(IRubyObject recv, IRubyObject[] args, Block
return newString;
}
- public IRubyObject initialize(IRubyObject[] args, Block block) {
+ public IRubyObject initialize(IRubyObject[] args, Block unusedBlock) {
if (checkArgumentCount(args, 0, 1) == 1) {
- replace(args[0], null);
+ replace(args[0]);
}
return this;
}
@@ -1399,7 +1399,7 @@ private IRubyObject sub(IRubyObject[] args, boolean bang, Block block) {
}
}
if (bang) {
- replace(newStr, block);
+ replace(newStr);
return this;
}
View
68 jruby/src/org/jruby/ext/openssl/ASN1.java
@@ -249,9 +249,9 @@ public static void createASN1(IRuby runtime, RubyModule ossl) {
mASN1.defineClassUnder("ASN1Error",openSSLError, openSSLError.getAllocator());
CallbackFactory asncb = runtime.callbackFactory(ASN1.class);
- mASN1.defineSingletonMethod("traverse",asncb.getSingletonMethod("traverse",IRubyObject.class));
- mASN1.defineSingletonMethod("decode",asncb.getSingletonMethod("decode",IRubyObject.class));
- mASN1.defineSingletonMethod("decode_all",asncb.getSingletonMethod("decode_all",IRubyObject.class));
+ mASN1.defineFastSingletonMethod("traverse",asncb.getFastSingletonMethod("traverse",IRubyObject.class));
+ mASN1.defineFastSingletonMethod("decode",asncb.getFastSingletonMethod("decode",IRubyObject.class));
+ mASN1.defineFastSingletonMethod("decode_all",asncb.getFastSingletonMethod("decode_all",IRubyObject.class));
List ary = new ArrayList();
mASN1.setConstant("UNIVERSAL_TAG_NAME",runtime.newArray(ary));
@@ -268,44 +268,44 @@ public static void createASN1(IRuby runtime, RubyModule ossl) {
cASN1Data.attr_accessor(new IRubyObject[]{runtime.newString("value"),runtime.newString("tag"),runtime.newString("tag_class")});
CallbackFactory asn1datacb = runtime.callbackFactory(ASN1Data.class);
cASN1Data.defineMethod("initialize",asn1datacb.getOptMethod("initialize"));
- cASN1Data.defineMethod("to_der",asn1datacb.getMethod("to_der"));
+ cASN1Data.defineFastMethod("to_der",asn1datacb.getFastMethod("to_der"));
RubyClass cASN1Primitive = mASN1.defineClassUnder("Primitive",cASN1Data, cASN1Data.getAllocator());
cASN1Primitive.attr_accessor(new IRubyObject[]{runtime.newString("tagging")});
CallbackFactory primcb = runtime.callbackFactory(ASN1Primitive.class);
cASN1Primitive.defineMethod("initialize",primcb.getOptMethod("initialize"));
- cASN1Primitive.defineMethod("to_der",primcb.getMethod("to_der"));
+ cASN1Primitive.defineFastMethod("to_der",primcb.getFastMethod("to_der"));
RubyClass cASN1Constructive = mASN1.defineClassUnder("Constructive",cASN1Data,cASN1Data.getAllocator());
cASN1Constructive.includeModule(runtime.getModule("Enumerable"));
cASN1Constructive.attr_accessor(new IRubyObject[]{runtime.newString("tagging")});
CallbackFactory concb = runtime.callbackFactory(ASN1Constructive.class);
cASN1Constructive.defineMethod("initialize",concb.getOptMethod("initialize"));
- cASN1Constructive.defineMethod("to_der",concb.getMethod("to_der"));
+ cASN1Constructive.defineFastMethod("to_der",concb.getFastMethod("to_der"));
cASN1Constructive.defineMethod("each",concb.getMethod("each"));
- mASN1.defineSingletonMethod("Boolean",asncb.getOptSingletonMethod("fact_Boolean"));
- mASN1.defineSingletonMethod("Integer",asncb.getOptSingletonMethod("fact_Integer"));
- mASN1.defineSingletonMethod("Enumerated",asncb.getOptSingletonMethod("fact_Enumerated"));
- mASN1.defineSingletonMethod("BitString",asncb.getOptSingletonMethod("fact_BitString"));
- mASN1.defineSingletonMethod("OctetString",asncb.getOptSingletonMethod("fact_OctetString"));
- mASN1.defineSingletonMethod("UTF8String",asncb.getOptSingletonMethod("fact_UTF8String"));
- mASN1.defineSingletonMethod("NumericString",asncb.getOptSingletonMethod("fact_NumericString"));
- mASN1.defineSingletonMethod("PrintableString",asncb.getOptSingletonMethod("fact_PrintableString"));
- mASN1.defineSingletonMethod("T61String",asncb.getOptSingletonMethod("fact_T61String"));
- mASN1.defineSingletonMethod("VideotexString",asncb.getOptSingletonMethod("fact_VideotexString"));
- mASN1.defineSingletonMethod("IA5String",asncb.getOptSingletonMethod("fact_IA5String"));
- mASN1.defineSingletonMethod("GraphicString",asncb.getOptSingletonMethod("fact_GraphicString"));
- mASN1.defineSingletonMethod("ISO64String",asncb.getOptSingletonMethod("fact_ISO64String"));
- mASN1.defineSingletonMethod("GeneralString",asncb.getOptSingletonMethod("fact_GeneralString"));
- mASN1.defineSingletonMethod("UniversalString",asncb.getOptSingletonMethod("fact_UniversalString"));
- mASN1.defineSingletonMethod("BMPString",asncb.getOptSingletonMethod("fact_BMPString"));
- mASN1.defineSingletonMethod("Null",asncb.getOptSingletonMethod("fact_Null"));
- mASN1.defineSingletonMethod("ObjectId",asncb.getOptSingletonMethod("fact_ObjectId"));
- mASN1.defineSingletonMethod("UTCTime",asncb.getOptSingletonMethod("fact_UTCTime"));
- mASN1.defineSingletonMethod("GeneralizedTime",asncb.getOptSingletonMethod("fact_GeneralizedTime"));
- mASN1.defineSingletonMethod("Sequence",asncb.getOptSingletonMethod("fact_Sequence"));
- mASN1.defineSingletonMethod("Set",asncb.getOptSingletonMethod("fact_Set"));
+ mASN1.defineFastSingletonMethod("Boolean",asncb.getFastOptSingletonMethod("fact_Boolean"));
+ mASN1.defineFastSingletonMethod("Integer",asncb.getFastOptSingletonMethod("fact_Integer"));
+ mASN1.defineFastSingletonMethod("Enumerated",asncb.getFastOptSingletonMethod("fact_Enumerated"));
+ mASN1.defineFastSingletonMethod("BitString",asncb.getFastOptSingletonMethod("fact_BitString"));
+ mASN1.defineFastSingletonMethod("OctetString",asncb.getFastOptSingletonMethod("fact_OctetString"));
+ mASN1.defineFastSingletonMethod("UTF8String",asncb.getFastOptSingletonMethod("fact_UTF8String"));
+ mASN1.defineFastSingletonMethod("NumericString",asncb.getFastOptSingletonMethod("fact_NumericString"));
+ mASN1.defineFastSingletonMethod("PrintableString",asncb.getFastOptSingletonMethod("fact_PrintableString"));
+ mASN1.defineFastSingletonMethod("T61String",asncb.getFastOptSingletonMethod("fact_T61String"));
+ mASN1.defineFastSingletonMethod("VideotexString",asncb.getFastOptSingletonMethod("fact_VideotexString"));
+ mASN1.defineFastSingletonMethod("IA5String",asncb.getFastOptSingletonMethod("fact_IA5String"));
+ mASN1.defineFastSingletonMethod("GraphicString",asncb.getFastOptSingletonMethod("fact_GraphicString"));
+ mASN1.defineFastSingletonMethod("ISO64String",asncb.getFastOptSingletonMethod("fact_ISO64String"));
+ mASN1.defineFastSingletonMethod("GeneralString",asncb.getFastOptSingletonMethod("fact_GeneralString"));
+ mASN1.defineFastSingletonMethod("UniversalString",asncb.getFastOptSingletonMethod("fact_UniversalString"));
+ mASN1.defineFastSingletonMethod("BMPString",asncb.getFastOptSingletonMethod("fact_BMPString"));
+ mASN1.defineFastSingletonMethod("Null",asncb.getFastOptSingletonMethod("fact_Null"));
+ mASN1.defineFastSingletonMethod("ObjectId",asncb.getFastOptSingletonMethod("fact_ObjectId"));
+ mASN1.defineFastSingletonMethod("UTCTime",asncb.getFastOptSingletonMethod("fact_UTCTime"));
+ mASN1.defineFastSingletonMethod("GeneralizedTime",asncb.getFastOptSingletonMethod("fact_GeneralizedTime"));
+ mASN1.defineFastSingletonMethod("Sequence",asncb.getFastOptSingletonMethod("fact_Sequence"));
+ mASN1.defineFastSingletonMethod("Set",asncb.getFastOptSingletonMethod("fact_Set"));
mASN1.defineClassUnder("Boolean",cASN1Primitive,cASN1Primitive.getAllocator());
mASN1.defineClassUnder("Integer",cASN1Primitive,cASN1Primitive.getAllocator());
@@ -330,12 +330,12 @@ public static void createASN1(IRuby runtime, RubyModule ossl) {
mASN1.defineClassUnder("Sequence",cASN1Constructive,cASN1Constructive.getAllocator());
mASN1.defineClassUnder("Set",cASN1Constructive,cASN1Constructive.getAllocator());
- cASN1ObjectId.defineSingletonMethod("register",asncb.getOptSingletonMethod("objectid_register"));
- cASN1ObjectId.defineMethod("sn",asncb.getSingletonMethod("objectid_sn"));
- cASN1ObjectId.defineMethod("ln",asncb.getSingletonMethod("objectid_ln"));
- cASN1ObjectId.defineMethod("short_name",asncb.getSingletonMethod("objectid_sn"));
- cASN1ObjectId.defineMethod("long_name",asncb.getSingletonMethod("objectid_ln"));
- cASN1ObjectId.defineMethod("oid",asncb.getSingletonMethod("objectid_oid"));
+ cASN1ObjectId.defineFastSingletonMethod("register",asncb.getFastOptSingletonMethod("objectid_register"));
+ cASN1ObjectId.defineFastMethod("sn",asncb.getFastSingletonMethod("objectid_sn"));
+ cASN1ObjectId.defineFastMethod("ln",asncb.getFastSingletonMethod("objectid_ln"));
+ cASN1ObjectId.defineFastMethod("short_name",asncb.getFastSingletonMethod("objectid_sn"));
+ cASN1ObjectId.defineFastMethod("long_name",asncb.getFastSingletonMethod("objectid_ln"));
+ cASN1ObjectId.defineFastMethod("oid",asncb.getFastSingletonMethod("objectid_oid"));
cASN1BitString.attr_accessor(new IRubyObject[]{runtime.newSymbol("unused_bits")});
}
View
13 jruby/src/org/jruby/ext/openssl/Attribute.java
@@ -36,6 +36,7 @@
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -59,11 +60,11 @@ public static void createAttribute(IRuby runtime, RubyModule mX509) {
CallbackFactory attrcb = runtime.callbackFactory(Attribute.class);
cAttribute.defineMethod("initialize",attrcb.getOptMethod("_initialize"));
- cAttribute.defineMethod("to_der",attrcb.getMethod("to_der"));
- cAttribute.defineMethod("oid",attrcb.getMethod("oid"));
- cAttribute.defineMethod("oid=",attrcb.getMethod("set_oid",IRubyObject.class));
- cAttribute.defineMethod("value",attrcb.getMethod("value"));
- cAttribute.defineMethod("value=",attrcb.getMethod("set_value",IRubyObject.class));
+ cAttribute.defineFastMethod("to_der",attrcb.getFastMethod("to_der"));
+ cAttribute.defineFastMethod("oid",attrcb.getFastMethod("oid"));
+ cAttribute.defineFastMethod("oid=",attrcb.getFastMethod("set_oid",IRubyObject.class));
+ cAttribute.defineFastMethod("value",attrcb.getFastMethod("value"));
+ cAttribute.defineFastMethod("value=",attrcb.getFastMethod("set_value",IRubyObject.class));
}
public Attribute(IRuby runtime, RubyClass type) {
@@ -95,7 +96,7 @@ DERObject toASN1() throws Exception {
return new DERSequence(v1);
}
- public IRubyObject _initialize(IRubyObject[] str) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] str, Block unusedBlock) throws Exception {
if(checkArgumentCount(str,1,2) == 1) {
IRubyObject _oid = OpenSSLImpl.to_der_if_possible(str[0]);
set_oid(_oid);
View
39 jruby/src/org/jruby/ext/openssl/Cipher.java
@@ -43,6 +43,7 @@
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
import org.jruby.exceptions.RaiseException;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -66,25 +67,25 @@ public static void createCipher(IRuby runtime, RubyModule ossl) {
CallbackFactory ciphercb = runtime.callbackFactory(Cipher.class);
- mCipher.defineSingletonMethod("ciphers",ciphercb.getSingletonMethod("ciphers"));
+ mCipher.defineFastSingletonMethod("ciphers",ciphercb.getFastSingletonMethod("ciphers"));
cCipher.defineMethod("initialize",ciphercb.getMethod("initialize",IRubyObject.class));
- cCipher.defineMethod("initialize_copy",ciphercb.getMethod("initialize_copy",IRubyObject.class));
- cCipher.defineMethod("clone",ciphercb.getMethod("rbClone"));
- cCipher.defineMethod("name",ciphercb.getMethod("name"));
- cCipher.defineMethod("key_len",ciphercb.getMethod("key_len"));
- cCipher.defineMethod("key_len=",ciphercb.getMethod("set_key_len",IRubyObject.class));
- cCipher.defineMethod("iv_len",ciphercb.getMethod("iv_len"));
- cCipher.defineMethod("block_size",ciphercb.getMethod("block_size"));
- cCipher.defineMethod("encrypt",ciphercb.getOptMethod("encrypt"));
- cCipher.defineMethod("decrypt",ciphercb.getOptMethod("decrypt"));
- cCipher.defineMethod("key=",ciphercb.getMethod("set_key",IRubyObject.class));
- cCipher.defineMethod("iv=",ciphercb.getMethod("set_iv",IRubyObject.class));
- cCipher.defineMethod("reset",ciphercb.getMethod("reset"));
- cCipher.defineMethod("pkcs5_keyivgen",ciphercb.getOptMethod("pkcs5_keyivgen"));
- cCipher.defineMethod("update",ciphercb.getMethod("update",IRubyObject.class));
- cCipher.defineMethod("<<",ciphercb.getMethod("update_deprecated",IRubyObject.class));
- cCipher.defineMethod("final",ciphercb.getMethod("_final"));
- cCipher.defineMethod("padding=",ciphercb.getMethod("set_padding",IRubyObject.class));
+ cCipher.defineFastMethod("initialize_copy",ciphercb.getFastMethod("initialize_copy",IRubyObject.class));
+ cCipher.defineFastMethod("clone",ciphercb.getFastMethod("rbClone"));
+ cCipher.defineFastMethod("name",ciphercb.getFastMethod("name"));
+ cCipher.defineFastMethod("key_len",ciphercb.getFastMethod("key_len"));
+ cCipher.defineFastMethod("key_len=",ciphercb.getFastMethod("set_key_len",IRubyObject.class));
+ cCipher.defineFastMethod("iv_len",ciphercb.getFastMethod("iv_len"));
+ cCipher.defineFastMethod("block_size",ciphercb.getFastMethod("block_size"));
+ cCipher.defineFastMethod("encrypt",ciphercb.getFastOptMethod("encrypt"));
+ cCipher.defineFastMethod("decrypt",ciphercb.getFastOptMethod("decrypt"));
+ cCipher.defineFastMethod("key=",ciphercb.getFastMethod("set_key",IRubyObject.class));
+ cCipher.defineFastMethod("iv=",ciphercb.getFastMethod("set_iv",IRubyObject.class));
+ cCipher.defineFastMethod("reset",ciphercb.getFastMethod("reset"));
+ cCipher.defineFastMethod("pkcs5_keyivgen",ciphercb.getFastOptMethod("pkcs5_keyivgen"));
+ cCipher.defineFastMethod("update",ciphercb.getFastMethod("update",IRubyObject.class));
+ cCipher.defineFastMethod("<<",ciphercb.getFastMethod("update_deprecated",IRubyObject.class));
+ cCipher.defineFastMethod("final",ciphercb.getFastMethod("_final"));
+ cCipher.defineFastMethod("padding=",ciphercb.getFastMethod("set_padding",IRubyObject.class));
}
private static final Set BLOCK_MODES = new HashSet();
@@ -190,7 +191,7 @@ public Cipher(IRuby runtime, RubyClass type) {
private byte[] iv;
private String padding;
- public IRubyObject initialize(IRubyObject str) {
+ public IRubyObject initialize(IRubyObject str, Block unusedBlock) {
name = str.toString();
String[] values = rubyToJavaCipher(name);
cryptoBase = values[0];
View
2  jruby/src/org/jruby/ext/openssl/Config.java
@@ -40,7 +40,7 @@
public static void createConfig(IRuby runtime, RubyModule ossl) {
RubyClass cConfig = ossl.defineClassUnder("Config", runtime.getObject(), runtime.getObject().getAllocator());
CallbackFactory confcb = runtime.callbackFactory(Config.class);
- cConfig.defineSingletonMethod("parse",confcb.getOptSingletonMethod("parse"));
+ cConfig.defineFastSingletonMethod("parse",confcb.getFastOptSingletonMethod("parse"));
}
public static IRubyObject parse(IRubyObject recv, IRubyObject[] args) {
View
28 jruby/src/org/jruby/ext/openssl/Digest.java
@@ -58,21 +58,21 @@ public static void createDigest(IRuby runtime, RubyModule ossl) {
CallbackFactory digestcb = runtime.callbackFactory(Digest.class);
cDigest.defineSingletonMethod("new",digestcb.getOptSingletonMethod("newInstance"));
- cDigest.defineSingletonMethod("digest",digestcb.getSingletonMethod("s_digest",IRubyObject.class,IRubyObject.class));
- cDigest.defineSingletonMethod("hexdigest",digestcb.getSingletonMethod("s_hexdigest",IRubyObject.class,IRubyObject.class));
+ cDigest.defineFastSingletonMethod("digest",digestcb.getFastSingletonMethod("s_digest",IRubyObject.class,IRubyObject.class));
+ cDigest.defineFastSingletonMethod("hexdigest",digestcb.getFastSingletonMethod("s_hexdigest",IRubyObject.class,IRubyObject.class));
cDigest.defineMethod("initialize",digestcb.getOptMethod("initialize"));
- cDigest.defineMethod("initialize_copy",digestcb.getMethod("initialize_copy",IRubyObject.class));
- cDigest.defineMethod("clone",digestcb.getMethod("rbClone"));
- cDigest.defineMethod("update",digestcb.getMethod("update",IRubyObject.class));
- cDigest.defineMethod("<<",digestcb.getMethod("update",IRubyObject.class));
- cDigest.defineMethod("digest",digestcb.getMethod("digest"));
- cDigest.defineMethod("hexdigest",digestcb.getMethod("hexdigest"));
- cDigest.defineMethod("inspect",digestcb.getMethod("hexdigest"));
- cDigest.defineMethod("to_s",digestcb.getMethod("hexdigest"));
- cDigest.defineMethod("==",digestcb.getMethod("eq",IRubyObject.class));
- cDigest.defineMethod("reset",digestcb.getMethod("reset"));
- cDigest.defineMethod("name",digestcb.getMethod("name"));
- cDigest.defineMethod("size",digestcb.getMethod("size"));
+ cDigest.defineFastMethod("initialize_copy",digestcb.getFastMethod("initialize_copy",IRubyObject.class));
+ cDigest.defineFastMethod("clone",digestcb.getFastMethod("rbClone"));
+ cDigest.defineFastMethod("update",digestcb.getFastMethod("update",IRubyObject.class));
+ cDigest.defineFastMethod("<<",digestcb.getFastMethod("update",IRubyObject.class));
+ cDigest.defineFastMethod("digest",digestcb.getFastMethod("digest"));
+ cDigest.defineFastMethod("hexdigest",digestcb.getFastMethod("hexdigest"));
+ cDigest.defineFastMethod("inspect",digestcb.getFastMethod("hexdigest"));
+ cDigest.defineFastMethod("to_s",digestcb.getFastMethod("hexdigest"));
+ cDigest.defineFastMethod("==",digestcb.getFastMethod("eq",IRubyObject.class));
+ cDigest.defineFastMethod("reset",digestcb.getFastMethod("reset"));
+ cDigest.defineFastMethod("name",digestcb.getFastMethod("name"));
+ cDigest.defineFastMethod("size",digestcb.getFastMethod("size"));
}
private static String transformDigest(String inp) {
View
23 jruby/src/org/jruby/ext/openssl/HMAC.java
@@ -35,6 +35,7 @@
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -56,17 +57,17 @@ public static void createHMAC(IRuby runtime, RubyModule ossl) {
CallbackFactory hmaccb = runtime.callbackFactory(HMAC.class);
- cHMAC.defineSingletonMethod("digest",hmaccb.getSingletonMethod("s_digest",IRubyObject.class,IRubyObject.class,IRubyObject.class));
- cHMAC.defineSingletonMethod("hexdigest",hmaccb.getSingletonMethod("s_hexdigest",IRubyObject.class,IRubyObject.class,IRubyObject.class));
+ cHMAC.defineFastSingletonMethod("digest",hmaccb.getFastSingletonMethod("s_digest",IRubyObject.class,IRubyObject.class,IRubyObject.class));
+ cHMAC.defineFastSingletonMethod("hexdigest",hmaccb.getFastSingletonMethod("s_hexdigest",IRubyObject.class,IRubyObject.class,IRubyObject.class));
cHMAC.defineMethod("initialize",hmaccb.getMethod("initialize",IRubyObject.class,IRubyObject.class));
- cHMAC.defineMethod("initialize_copy",hmaccb.getMethod("initialize_copy",IRubyObject.class));
- cHMAC.defineMethod("clone",hmaccb.getMethod("rbClone"));
- cHMAC.defineMethod("update",hmaccb.getMethod("update",IRubyObject.class));
- cHMAC.defineMethod("<<",hmaccb.getMethod("update",IRubyObject.class));
- cHMAC.defineMethod("digest",hmaccb.getMethod("digest"));
- cHMAC.defineMethod("hexdigest",hmaccb.getMethod("hexdigest"));
- cHMAC.defineMethod("inspect",hmaccb.getMethod("hexdigest"));
- cHMAC.defineMethod("to_s",hmaccb.getMethod("hexdigest"));
+ cHMAC.defineFastMethod("initialize_copy",hmaccb.getFastMethod("initialize_copy",IRubyObject.class));
+ cHMAC.defineFastMethod("clone",hmaccb.getFastMethod("rbClone"));
+ cHMAC.defineFastMethod("update",hmaccb.getFastMethod("update",IRubyObject.class));
+ cHMAC.defineFastMethod("<<",hmaccb.getFastMethod("update",IRubyObject.class));
+ cHMAC.defineFastMethod("digest",hmaccb.getFastMethod("digest"));
+ cHMAC.defineFastMethod("hexdigest",hmaccb.getFastMethod("hexdigest"));
+ cHMAC.defineFastMethod("inspect",hmaccb.getFastMethod("hexdigest"));
+ cHMAC.defineFastMethod("to_s",hmaccb.getFastMethod("hexdigest"));
}
public static IRubyObject s_digest(IRubyObject recv, IRubyObject digest, IRubyObject kay, IRubyObject data) {
@@ -103,7 +104,7 @@ public HMAC(IRuby runtime, RubyClass type) {
private byte[] key;
private StringBuffer data = new StringBuffer();
- public IRubyObject initialize(IRubyObject kay, IRubyObject digest) {
+ public IRubyObject initialize(IRubyObject kay, IRubyObject digest, Block unusedBlock) {
String name = "HMAC" + ((Digest)digest).getAlgorithm();
try {
mac = Mac.getInstance(name);
View
23 jruby/src/org/jruby/ext/openssl/NetscapeSPKI.java
@@ -39,6 +39,7 @@
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -62,16 +63,16 @@ public static void createNetscapeSPKI(IRuby runtime, RubyModule ossl) {
CallbackFactory spkicb = runtime.callbackFactory(NetscapeSPKI.class);
cSPKI.defineMethod("initialize",spkicb.getOptMethod("_initialize"));
- cSPKI.defineMethod("to_der",spkicb.getMethod("to_der"));
- cSPKI.defineMethod("to_pem",spkicb.getMethod("to_pem"));
- cSPKI.defineMethod("to_s",spkicb.getMethod("to_pem"));
- cSPKI.defineMethod("to_text",spkicb.getMethod("to_text"));
- cSPKI.defineMethod("public_key",spkicb.getMethod("public_key"));
- cSPKI.defineMethod("public_key=",spkicb.getMethod("set_public_key",IRubyObject.class));
- cSPKI.defineMethod("sign",spkicb.getMethod("sign",IRubyObject.class,IRubyObject.class));
- cSPKI.defineMethod("verify",spkicb.getMethod("verify",IRubyObject.class));
- cSPKI.defineMethod("challenge",spkicb.getMethod("challenge"));
- cSPKI.defineMethod("challenge=",spkicb.getMethod("set_challenge",IRubyObject.class));
+ cSPKI.defineFastMethod("to_der",spkicb.getFastMethod("to_der"));
+ cSPKI.defineFastMethod("to_pem",spkicb.getFastMethod("to_pem"));
+ cSPKI.defineFastMethod("to_s",spkicb.getFastMethod("to_pem"));
+ cSPKI.defineFastMethod("to_text",spkicb.getFastMethod("to_text"));
+ cSPKI.defineFastMethod("public_key",spkicb.getFastMethod("public_key"));
+ cSPKI.defineFastMethod("public_key=",spkicb.getFastMethod("set_public_key",IRubyObject.class));
+ cSPKI.defineFastMethod("sign",spkicb.getFastMethod("sign",IRubyObject.class,IRubyObject.class));
+ cSPKI.defineFastMethod("verify",spkicb.getFastMethod("verify",IRubyObject.class));
+ cSPKI.defineFastMethod("challenge",spkicb.getFastMethod("challenge"));
+ cSPKI.defineFastMethod("challenge=",spkicb.getFastMethod("set_challenge",IRubyObject.class));
}
public NetscapeSPKI(IRuby runtime, RubyClass type) {
@@ -83,7 +84,7 @@ public NetscapeSPKI(IRuby runtime, RubyClass type) {
private NetscapeCertRequest cert;
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block unusedBlock) throws Exception {
if(args.length > 0) {
byte[] b = args[0].toString().getBytes("PLAIN");
try {
View
83 jruby/src/org/jruby/ext/openssl/PKCS7.java
@@ -50,11 +50,11 @@
import org.jruby.RubyArray;
import org.jruby.RubyClass;
import org.jruby.RubyModule;
-import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
import org.jruby.ext.openssl.x509store.PEM;
import org.jruby.ext.openssl.x509store.X509AuxCertificate;
import org.jruby.ext.openssl.x509store.X509_STORE_CTX;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -72,37 +72,38 @@ public static void createPKCS7(IRuby runtime, RubyModule mOSSL) {
cPKCS7.attr_accessor(new IRubyObject[]{runtime.newSymbol("data"),runtime.newSymbol("error_string")});
CallbackFactory p7cb = runtime.callbackFactory(PKCS7.class);
- mPKCS7.defineSingletonMethod("read_smime",p7cb.getSingletonMethod("read_smime",IRubyObject.class));
- mPKCS7.defineSingletonMethod("write_smime",p7cb.getOptSingletonMethod("write_smime"));
- mPKCS7.defineSingletonMethod("sign",p7cb.getOptSingletonMethod("sign"));
- mPKCS7.defineSingletonMethod("encrypt",p7cb.getOptSingletonMethod("encrypt"));
- cPKCS7.defineSingletonMethod("new",p7cb.getOptSingletonMethod("newInstance"));
+ mPKCS7.defineFastSingletonMethod("read_smime",p7cb.getFastSingletonMethod("read_smime",IRubyObject.class));
+ mPKCS7.defineFastSingletonMethod("write_smime",p7cb.getFastOptSingletonMethod("write_smime"));
+ mPKCS7.defineFastSingletonMethod("sign",p7cb.getFastOptSingletonMethod("sign"));
+ mPKCS7.defineFastSingletonMethod("encrypt",p7cb.getFastOptSingletonMethod("encrypt"));
+ // FIXME: This was defined, but does not exist? Should it?
+ //cPKCS7.defineFastSingletonMethod("new",p7cb.getFastOptSingletonMethod("newInstance"));
cPKCS7.defineMethod("initialize",p7cb.getOptMethod("_initialize"));
- cPKCS7.defineMethod("initialize_copy",p7cb.getMethod("initialize_copy",IRubyObject.class));
- cPKCS7.defineMethod("clone",p7cb.getMethod("rbClone"));
- cPKCS7.defineMethod("type=",p7cb.getMethod("set_type",IRubyObject.class));
- cPKCS7.defineMethod("type",p7cb.getMethod("get_type"));
- cPKCS7.defineMethod("detached=",p7cb.getMethod("set_detached",IRubyObject.class));
- cPKCS7.defineMethod("detached",p7cb.getMethod("detached"));
- cPKCS7.defineMethod("detached?",p7cb.getMethod("detached_p"));
- cPKCS7.defineMethod("cipher=",p7cb.getMethod("set_cipher",IRubyObject.class));
- cPKCS7.defineMethod("add_signer",p7cb.getMethod("add_signer",IRubyObject.class));
- cPKCS7.defineMethod("signers",p7cb.getMethod("signers"));
- cPKCS7.defineMethod("add_recipient",p7cb.getMethod("add_recipient",IRubyObject.class));
- cPKCS7.defineMethod("recipients",p7cb.getMethod("recipients"));
- cPKCS7.defineMethod("add_certificate",p7cb.getMethod("add_certificate",IRubyObject.class));
- cPKCS7.defineMethod("certificates=",p7cb.getMethod("set_certificates",IRubyObject.class));
- cPKCS7.defineMethod("certificates",p7cb.getMethod("certificates"));
- cPKCS7.defineMethod("add_crl",p7cb.getMethod("add_crl",IRubyObject.class));
- cPKCS7.defineMethod("crls=",p7cb.getMethod("set_crls",IRubyObject.class));
- cPKCS7.defineMethod("crls",p7cb.getMethod("crls"));
- cPKCS7.defineMethod("add_data",p7cb.getMethod("add_data",IRubyObject.class));
- cPKCS7.defineMethod("data=",p7cb.getMethod("add_data",IRubyObject.class));
- cPKCS7.defineMethod("verify",p7cb.getOptMethod("verify"));
- cPKCS7.defineMethod("decrypt",p7cb.getOptMethod("decrypt"));
- cPKCS7.defineMethod("to_pem",p7cb.getMethod("to_pem"));
- cPKCS7.defineMethod("to_s",p7cb.getMethod("to_pem"));
- cPKCS7.defineMethod("to_der",p7cb.getMethod("to_der"));
+ cPKCS7.defineFastMethod("initialize_copy",p7cb.getFastMethod("initialize_copy",IRubyObject.class));
+ cPKCS7.defineFastMethod("clone",p7cb.getFastMethod("rbClone"));
+ cPKCS7.defineFastMethod("type=",p7cb.getFastMethod("set_type",IRubyObject.class));
+ cPKCS7.defineFastMethod("type",p7cb.getFastMethod("get_type"));
+ cPKCS7.defineFastMethod("detached=",p7cb.getFastMethod("set_detached",IRubyObject.class));
+ cPKCS7.defineFastMethod("detached",p7cb.getFastMethod("detached"));
+ cPKCS7.defineFastMethod("detached?",p7cb.getFastMethod("detached_p"));
+ cPKCS7.defineFastMethod("cipher=",p7cb.getFastMethod("set_cipher",IRubyObject.class));
+ cPKCS7.defineFastMethod("add_signer",p7cb.getFastMethod("add_signer",IRubyObject.class));
+ cPKCS7.defineFastMethod("signers",p7cb.getFastMethod("signers"));
+ cPKCS7.defineFastMethod("add_recipient",p7cb.getFastMethod("add_recipient",IRubyObject.class));
+ cPKCS7.defineFastMethod("recipients",p7cb.getFastMethod("recipients"));
+ cPKCS7.defineFastMethod("add_certificate",p7cb.getFastMethod("add_certificate",IRubyObject.class));
+ cPKCS7.defineFastMethod("certificates=",p7cb.getFastMethod("set_certificates",IRubyObject.class));
+ cPKCS7.defineFastMethod("certificates",p7cb.getFastMethod("certificates"));
+ cPKCS7.defineFastMethod("add_crl",p7cb.getFastMethod("add_crl",IRubyObject.class));
+ cPKCS7.defineFastMethod("crls=",p7cb.getFastMethod("set_crls",IRubyObject.class));
+ cPKCS7.defineFastMethod("crls",p7cb.getFastMethod("crls"));
+ cPKCS7.defineFastMethod("add_data",p7cb.getFastMethod("add_data",IRubyObject.class));
+ cPKCS7.defineFastMethod("data=",p7cb.getFastMethod("add_data",IRubyObject.class));
+ cPKCS7.defineFastMethod("verify",p7cb.getFastOptMethod("verify"));
+ cPKCS7.defineFastMethod("decrypt",p7cb.getFastOptMethod("decrypt"));
+ cPKCS7.defineFastMethod("to_pem",p7cb.getFastMethod("to_pem"));
+ cPKCS7.defineFastMethod("to_s",p7cb.getFastMethod("to_pem"));
+ cPKCS7.defineFastMethod("to_der",p7cb.getFastMethod("to_der"));
SignerInfo.createSignerInfo(runtime,mPKCS7);
RecipientInfo.createRecipientInfo(runtime,mPKCS7);
@@ -187,7 +188,7 @@ public PKCS7(IRuby runtime, RubyClass type) {
private CMSSignedData signedData;
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block unusedBlock) throws Exception {
if(checkArgumentCount(args,0,1) == 0) {
return this;
}
@@ -394,11 +395,11 @@ public static void createSignerInfo(IRuby runtime, RubyModule mPKCS7) {
mPKCS7.defineConstant("Signer",cPKCS7Signer);
CallbackFactory p7scb = runtime.callbackFactory(SignerInfo.class);
- cPKCS7Signer.defineMethod("initialize",p7scb.getMethod("initialize",IRubyObject.class,IRubyObject.class,IRubyObject.class));
- cPKCS7Signer.defineMethod("issuer",p7scb.getMethod("issuer"));
- cPKCS7Signer.defineMethod("name",p7scb.getMethod("issuer"));
- cPKCS7Signer.defineMethod("serial",p7scb.getMethod("serial"));
- cPKCS7Signer.defineMethod("signed_time",p7scb.getMethod("signed_time"));
+ cPKCS7Signer.defineFastMethod("initialize",p7scb.getFastMethod("initialize",IRubyObject.class,IRubyObject.class,IRubyObject.class));
+ cPKCS7Signer.defineFastMethod("issuer",p7scb.getFastMethod("issuer"));
+ cPKCS7Signer.defineFastMethod("name",p7scb.getFastMethod("issuer"));
+ cPKCS7Signer.defineFastMethod("serial",p7scb.getFastMethod("serial"));
+ cPKCS7Signer.defineFastMethod("signed_time",p7scb.getFastMethod("signed_time"));
}
public SignerInfo(IRuby runtime, RubyClass type) {
@@ -437,10 +438,10 @@ public static void createRecipientInfo(IRuby runtime, RubyModule mPKCS7) {
RubyClass cPKCS7Recipient = mPKCS7.defineClassUnder("RecipientInfo",runtime.getObject(),RECIPIENTINFO_ALLOCATOR);
CallbackFactory p7rcb = runtime.callbackFactory(RecipientInfo.class);
- cPKCS7Recipient.defineMethod("initialize",p7rcb.getMethod("initialize",IRubyObject.class));
- cPKCS7Recipient.defineMethod("issuer",p7rcb.getMethod("issuer"));
- cPKCS7Recipient.defineMethod("serial",p7rcb.getMethod("serial"));
- cPKCS7Recipient.defineMethod("enc_key",p7rcb.getMethod("enc_key"));
+ cPKCS7Recipient.defineFastMethod("initialize",p7rcb.getFastMethod("initialize",IRubyObject.class));
+ cPKCS7Recipient.defineFastMethod("issuer",p7rcb.getFastMethod("issuer"));
+ cPKCS7Recipient.defineFastMethod("serial",p7rcb.getFastMethod("serial"));
+ cPKCS7Recipient.defineFastMethod("enc_key",p7rcb.getFastMethod("enc_key"));
}
public RecipientInfo(IRuby runtime, RubyClass type) {
View
7 jruby/src/org/jruby/ext/openssl/PKey.java
@@ -35,6 +35,7 @@
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -53,8 +54,8 @@ public static void createPKey(IRuby runtime, RubyModule ossl) {
CallbackFactory pkeycb = runtime.callbackFactory(PKey.class);
cPKey.defineMethod("initialize",pkeycb.getMethod("initialize"));
- cPKey.defineMethod("sign",pkeycb.getMethod("sign",IRubyObject.class,IRubyObject.class));
- cPKey.defineMethod("verify",pkeycb.getMethod("verify",IRubyObject.class,IRubyObject.class,IRubyObject.class));
+ cPKey.defineFastMethod("sign",pkeycb.getFastMethod("sign",IRubyObject.class,IRubyObject.class));
+ cPKey.defineFastMethod("verify",pkeycb.getFastMethod("verify",IRubyObject.class,IRubyObject.class,IRubyObject.class));
PKeyRSA.createPKeyRSA(runtime,mPKey);
PKeyDSA.createPKeyDSA(runtime,mPKey);
@@ -65,7 +66,7 @@ public PKey(IRuby runtime, RubyClass type) {
super(runtime,type);
}
- public IRubyObject initialize() {
+ public IRubyObject initialize(Block unusedBlock) {
return this;
}
View
23 jruby/src/org/jruby/ext/openssl/PKeyDSA.java
@@ -48,6 +48,7 @@
import org.jruby.RubyModule;
import org.jruby.exceptions.RaiseException;
import org.jruby.ext.openssl.x509store.PEM;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -71,16 +72,16 @@ public static void createPKeyDSA(IRuby runtime, RubyModule mPKey) {
cDSA.defineMethod("initialize",dsacb.getOptMethod("initialize"));
- cDSA.defineMethod("public?",dsacb.getMethod("public_p"));
- cDSA.defineMethod("private?",dsacb.getMethod("private_p"));
- cDSA.defineMethod("to_der",dsacb.getMethod("to_der"));
- cDSA.defineMethod("to_text",dsacb.getMethod("to_text"));
- cDSA.defineMethod("public_key",dsacb.getMethod("public_key"));
- cDSA.defineMethod("export",dsacb.getOptMethod("export"));
- cDSA.defineMethod("to_pem",dsacb.getOptMethod("export"));
- cDSA.defineMethod("to_s",dsacb.getOptMethod("export"));
- cDSA.defineMethod("syssign",dsacb.getMethod("syssign",IRubyObject.class));
- cDSA.defineMethod("sysverify",dsacb.getMethod("sysverify",IRubyObject.class,IRubyObject.class));
+ cDSA.defineFastMethod("public?",dsacb.getFastMethod("public_p"));
+ cDSA.defineFastMethod("private?",dsacb.getFastMethod("private_p"));
+ cDSA.defineFastMethod("to_der",dsacb.getFastMethod("to_der"));
+ cDSA.defineFastMethod("to_text",dsacb.getFastMethod("to_text"));
+ cDSA.defineFastMethod("public_key",dsacb.getFastMethod("public_key"));
+ cDSA.defineFastMethod("export",dsacb.getFastOptMethod("export"));
+ cDSA.defineFastMethod("to_pem",dsacb.getFastOptMethod("export"));
+ cDSA.defineFastMethod("to_s",dsacb.getFastOptMethod("export"));
+ cDSA.defineFastMethod("syssign",dsacb.getFastMethod("syssign",IRubyObject.class));
+ cDSA.defineFastMethod("sysverify",dsacb.getFastMethod("sysverify",IRubyObject.class,IRubyObject.class));
}
public PKeyDSA(IRuby runtime, RubyClass type) {
@@ -102,7 +103,7 @@ String getAlgorithm() {
return "DSA";
}
- public IRubyObject initialize(IRubyObject[] args) {
+ public IRubyObject initialize(IRubyObject[] args, Block unusedBlock) {
Object rsa;
IRubyObject arg;
IRubyObject pass = null;
View
25 jruby/src/org/jruby/ext/openssl/PKeyRSA.java
@@ -56,6 +56,7 @@
import org.jruby.RubyNumeric;
import org.jruby.exceptions.RaiseException;
import org.jruby.ext.openssl.x509store.PEM;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -78,17 +79,17 @@ public static void createPKeyRSA(IRuby runtime, RubyModule mPKey) {
CallbackFactory rsacb = runtime.callbackFactory(PKeyRSA.class);
cRSA.defineMethod("initialize",rsacb.getOptMethod("initialize"));
- cRSA.defineMethod("public?",rsacb.getMethod("public_p"));
- cRSA.defineMethod("private?",rsacb.getMethod("private_p"));
- cRSA.defineMethod("to_der",rsacb.getMethod("to_der"));
- cRSA.defineMethod("public_key",rsacb.getMethod("public_key"));
- cRSA.defineMethod("export",rsacb.getOptMethod("export"));
- cRSA.defineMethod("to_pem",rsacb.getOptMethod("export"));
- cRSA.defineMethod("to_s",rsacb.getOptMethod("export"));
- cRSA.defineMethod("private_encrypt",rsacb.getOptMethod("private_encrypt"));
- cRSA.defineMethod("private_decrypt",rsacb.getOptMethod("private_decrypt"));
- cRSA.defineMethod("public_encrypt",rsacb.getOptMethod("public_encrypt"));
- cRSA.defineMethod("public_decrypt",rsacb.getOptMethod("public_decrypt"));
+ cRSA.defineFastMethod("public?",rsacb.getFastMethod("public_p"));
+ cRSA.defineFastMethod("private?",rsacb.getFastMethod("private_p"));
+ cRSA.defineFastMethod("to_der",rsacb.getFastMethod("to_der"));
+ cRSA.defineFastMethod("public_key",rsacb.getFastMethod("public_key"));
+ cRSA.defineFastMethod("export",rsacb.getFastOptMethod("export"));
+ cRSA.defineFastMethod("to_pem",rsacb.getFastOptMethod("export"));
+ cRSA.defineFastMethod("to_s",rsacb.getFastOptMethod("export"));
+ cRSA.defineFastMethod("private_encrypt",rsacb.getFastOptMethod("private_encrypt"));
+ cRSA.defineFastMethod("private_decrypt",rsacb.getFastOptMethod("private_decrypt"));
+ cRSA.defineFastMethod("public_encrypt",rsacb.getFastOptMethod("public_encrypt"));
+ cRSA.defineMethod("public_decrypt",rsacb.getFastOptMethod("public_decrypt"));
cRSA.setConstant("PKCS1_PADDING",runtime.newFixnum(1));
cRSA.setConstant("SSLV23_PADDING",runtime.newFixnum(2));
@@ -115,7 +116,7 @@ String getAlgorithm() {
return "RSA";
}
- public IRubyObject initialize(IRubyObject[] args) {
+ public IRubyObject initialize(IRubyObject[] args, Block block) {
Object rsa;
IRubyObject arg;
IRubyObject pass = null;
View
14 jruby/src/org/jruby/ext/openssl/Random.java
@@ -40,13 +40,13 @@ public static void createRandom(IRuby runtime, RubyModule ossl) {
RubyModule rand = ossl.defineModuleUnder("Random");
CallbackFactory randcb = runtime.callbackFactory(Random.class);
- rand.defineSingletonMethod("seed",randcb.getOptSingletonMethod("seed"));
- rand.defineSingletonMethod("load_random_file",randcb.getOptSingletonMethod("load_random_file"));
- rand.defineSingletonMethod("write_random_file",randcb.getOptSingletonMethod("write_random_file"));
- rand.defineSingletonMethod("random_bytes",randcb.getOptSingletonMethod("random_bytes"));
- rand.defineSingletonMethod("pseudo_bytes",randcb.getOptSingletonMethod("pseudo_bytes"));
- rand.defineSingletonMethod("egd",randcb.getOptSingletonMethod("egd"));
- rand.defineSingletonMethod("egd_bytes",randcb.getOptSingletonMethod("egd_bytes"));
+ rand.defineFastSingletonMethod("seed",randcb.getFastOptSingletonMethod("seed"));
+ rand.defineFastSingletonMethod("load_random_file",randcb.getFastOptSingletonMethod("load_random_file"));
+ rand.defineFastSingletonMethod("write_random_file",randcb.getFastOptSingletonMethod("write_random_file"));
+ rand.defineFastSingletonMethod("random_bytes",randcb.getFastOptSingletonMethod("random_bytes"));
+ rand.defineFastSingletonMethod("pseudo_bytes",randcb.getFastOptSingletonMethod("pseudo_bytes"));
+ rand.defineFastSingletonMethod("egd",randcb.getFastOptSingletonMethod("egd"));
+ rand.defineFastSingletonMethod("egd_bytes",randcb.getFastOptSingletonMethod("egd_bytes"));
}
public static IRubyObject seed(IRubyObject recv, IRubyObject[] args) {
View
39 jruby/src/org/jruby/ext/openssl/Request.java
@@ -46,6 +46,7 @@
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
import org.jruby.exceptions.RaiseException;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
@@ -69,24 +70,24 @@ public static void createRequest(IRuby runtime, RubyModule mX509) {
CallbackFactory reqcb = runtime.callbackFactory(Request.class);
cRequest.defineMethod("initialize",reqcb.getOptMethod("_initialize"));
- cRequest.defineMethod("initialize_copy",reqcb.getMethod("initialize_copy",IRubyObject.class));
- cRequest.defineMethod("clone",reqcb.getMethod("rbClone"));
- cRequest.defineMethod("to_pem",reqcb.getMethod("to_pem"));
- cRequest.defineMethod("to_der",reqcb.getMethod("to_der"));
- cRequest.defineMethod("to_s",reqcb.getMethod("to_pem"));
- cRequest.defineMethod("to_text",reqcb.getMethod("to_text"));
- cRequest.defineMethod("version",reqcb.getMethod("version"));
- cRequest.defineMethod("version=",reqcb.getMethod("set_version",IRubyObject.class));
- cRequest.defineMethod("subject",reqcb.getMethod("subject"));
- cRequest.defineMethod("subject=",reqcb.getMethod("set_subject",IRubyObject.class));
- cRequest.defineMethod("signature_algorithm",reqcb.getMethod("signature_algorithm"));
- cRequest.defineMethod("public_key",reqcb.getMethod("public_key"));
- cRequest.defineMethod("public_key=",reqcb.getMethod("set_public_key",IRubyObject.class));
- cRequest.defineMethod("sign",reqcb.getMethod("sign",IRubyObject.class,IRubyObject.class));
- cRequest.defineMethod("verify",reqcb.getMethod("verify",IRubyObject.class));
- cRequest.defineMethod("attributes",reqcb.getMethod("attributes"));
- cRequest.defineMethod("attributes=",reqcb.getMethod("set_attributes",IRubyObject.class));
- cRequest.defineMethod("add_attribute",reqcb.getMethod("add_attribute",IRubyObject.class));
+ cRequest.defineFastMethod("initialize_copy",reqcb.getFastMethod("initialize_copy",IRubyObject.class));
+ cRequest.defineFastMethod("clone",reqcb.getFastMethod("rbClone"));
+ cRequest.defineFastMethod("to_pem",reqcb.getFastMethod("to_pem"));
+ cRequest.defineFastMethod("to_der",reqcb.getFastMethod("to_der"));
+ cRequest.defineFastMethod("to_s",reqcb.getFastMethod("to_pem"));
+ cRequest.defineFastMethod("to_text",reqcb.getFastMethod("to_text"));
+ cRequest.defineFastMethod("version",reqcb.getFastMethod("version"));
+ cRequest.defineFastMethod("version=",reqcb.getFastMethod("set_version",IRubyObject.class));
+ cRequest.defineFastMethod("subject",reqcb.getFastMethod("subject"));
+ cRequest.defineFastMethod("subject=",reqcb.getFastMethod("set_subject",IRubyObject.class));
+ cRequest.defineFastMethod("signature_algorithm",reqcb.getFastMethod("signature_algorithm"));
+ cRequest.defineFastMethod("public_key",reqcb.getFastMethod("public_key"));
+ cRequest.defineFastMethod("public_key=",reqcb.getFastMethod("set_public_key",IRubyObject.class));
+ cRequest.defineFastMethod("sign",reqcb.getFastMethod("sign",IRubyObject.class,IRubyObject.class));
+ cRequest.defineFastMethod("verify",reqcb.getFastMethod("verify",IRubyObject.class));
+ cRequest.defineFastMethod("attributes",reqcb.getFastMethod("attributes"));
+ cRequest.defineFastMethod("attributes=",reqcb.getFastMethod("set_attributes",IRubyObject.class));
+ cRequest.defineFastMethod("add_attribute",reqcb.getFastMethod("add_attribute",IRubyObject.class));
}
private IRubyObject version;
@@ -103,7 +104,7 @@ public Request(IRuby runtime, RubyClass type) {
attrs = new ArrayList();
}
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block block) throws Exception {
if(checkArgumentCount(args,0,1) == 0) {
return this;
}
View
7 jruby/src/org/jruby/ext/openssl/SSLContext.java
@@ -43,6 +43,7 @@
import org.jruby.ext.openssl.x509store.X509AuxCertificate;
import org.jruby.ext.openssl.x509store.X509_STORE;
import org.jruby.ext.openssl.x509store.X509_STORE_CTX;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -71,8 +72,8 @@ public static void createSSLContext(IRuby runtime, RubyModule mSSL) {
CallbackFactory ctxcb = runtime.callbackFactory(SSLContext.class);
cSSLContext.defineMethod("initialize",ctxcb.getOptMethod("initialize"));
- cSSLContext.defineMethod("ciphers",ctxcb.getMethod("ciphers"));
- cSSLContext.defineMethod("ciphers=",ctxcb.getMethod("set_ciphers",IRubyObject.class));
+ cSSLContext.defineFastMethod("ciphers",ctxcb.getFastMethod("ciphers"));
+ cSSLContext.defineFastMethod("ciphers=",ctxcb.getFastMethod("set_ciphers",IRubyObject.class));
}
public SSLContext(IRuby runtime, RubyClass type) {
@@ -115,7 +116,7 @@ public X509Cert getCallbackCert() {
return t_cert;
}
- public IRubyObject initialize(IRubyObject[] args) {
+ public IRubyObject initialize(IRubyObject[] args, Block unusedBlock) {
ciphers = getRuntime().getNil();
return this;
}
View
25 jruby/src/org/jruby/ext/openssl/SSLSocket.java
@@ -46,6 +46,7 @@
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
import org.jruby.exceptions.RaiseException;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallType;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
@@ -72,17 +73,17 @@ public static void createSSLSocket(IRuby runtime, RubyModule mSSL) {
CallbackFactory sockcb = runtime.callbackFactory(SSLSocket.class);
cSSLSocket.defineAlias("to_io","io");
cSSLSocket.defineMethod("initialize",sockcb.getOptMethod("_initialize"));
- cSSLSocket.defineMethod("connect",sockcb.getMethod("connect"));
- cSSLSocket.defineMethod("accept",sockcb.getMethod("accept"));
- cSSLSocket.defineMethod("sysread",sockcb.getOptMethod("sysread"));
- cSSLSocket.defineMethod("syswrite",sockcb.getMethod("syswrite",IRubyObject.class));
- cSSLSocket.defineMethod("sysclose",sockcb.getMethod("sysclose"));
- cSSLSocket.defineMethod("cert",sockcb.getMethod("cert"));
- cSSLSocket.defineMethod("peer_cert",sockcb.getMethod("peer_cert"));
- cSSLSocket.defineMethod("peer_cert_chain",sockcb.getMethod("peer_cert_chain"));
- cSSLSocket.defineMethod("cipher",sockcb.getMethod("cipher"));
- cSSLSocket.defineMethod("state",sockcb.getMethod("state"));
- cSSLSocket.defineMethod("pending",sockcb.getMethod("pending"));
+ cSSLSocket.defineFastMethod("connect",sockcb.getFastMethod("connect"));
+ cSSLSocket.defineFastMethod("accept",sockcb.getFastMethod("accept"));
+ cSSLSocket.defineFastMethod("sysread",sockcb.getFastOptMethod("sysread"));
+ cSSLSocket.defineFastMethod("syswrite",sockcb.getFastMethod("syswrite",IRubyObject.class));
+ cSSLSocket.defineFastMethod("sysclose",sockcb.getFastMethod("sysclose"));
+ cSSLSocket.defineFastMethod("cert",sockcb.getFastMethod("cert"));
+ cSSLSocket.defineFastMethod("peer_cert",sockcb.getFastMethod("peer_cert"));
+ cSSLSocket.defineFastMethod("peer_cert_chain",sockcb.getFastMethod("peer_cert_chain"));
+ cSSLSocket.defineFastMethod("cipher",sockcb.getFastMethod("cipher"));
+ cSSLSocket.defineFastMethod("state",sockcb.getFastMethod("state"));
+ cSSLSocket.defineFastMethod("pending",sockcb.getFastMethod("pending"));
}
private RubyClass sslError;
@@ -111,7 +112,7 @@ public SSLSocket(IRuby runtime, RubyClass type) {
private Selector wsel;
private Selector asel;
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block unusedBlock) throws Exception {
IRubyObject io, ctx;
ThreadContext tc = getRuntime().getCurrentContext();
if(checkArgumentCount(args,1,2) == 1) {
View
55 jruby/src/org/jruby/ext/openssl/X509CRL.java
@@ -57,6 +57,7 @@
import org.jruby.RubyTime;
import org.jruby.exceptions.RaiseException;
import org.jruby.ext.openssl.x509store.PEM;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
@@ -80,32 +81,32 @@ public static void createX509CRL(IRuby runtime, RubyModule mX509) {
CallbackFactory crlcb = runtime.callbackFactory(X509CRL.class);
cX509CRL.defineMethod("initialize",crlcb.getOptMethod("_initialize"));
- cX509CRL.defineMethod("initialize_copy",crlcb.getMethod("initialize_copy",IRubyObject.class));
- cX509CRL.defineMethod("clone",crlcb.getMethod("rbClone"));
-
- cX509CRL.defineMethod("version",crlcb.getMethod("version"));
- cX509CRL.defineMethod("version=",crlcb.getMethod("set_version",IRubyObject.class));
- cX509CRL.defineMethod("signature_algorithm",crlcb.getMethod("signature_algorithm"));
- cX509CRL.defineMethod("issuer",crlcb.getMethod("issuer"));
- cX509CRL.defineMethod("issuer=",crlcb.getMethod("set_issuer",IRubyObject.class));
- cX509CRL.defineMethod("last_update",crlcb.getMethod("last_update"));
- cX509CRL.defineMethod("last_update=",crlcb.getMethod("set_last_update",IRubyObject.class));
- cX509CRL.defineMethod("next_update",crlcb.getMethod("next_update"));
- cX509CRL.defineMethod("next_update=",crlcb.getMethod("set_next_update",IRubyObject.class));
- cX509CRL.defineMethod("revoked",crlcb.getMethod("revoked"));
- cX509CRL.defineMethod("revoked=",crlcb.getMethod("set_revoked",IRubyObject.class));
- cX509CRL.defineMethod("add_revoked",crlcb.getMethod("add_revoked",IRubyObject.class));
-
- cX509CRL.defineMethod("sign",crlcb.getMethod("sign",IRubyObject.class,IRubyObject.class));
- cX509CRL.defineMethod("verify",crlcb.getMethod("verify",IRubyObject.class));
-
- cX509CRL.defineMethod("to_der",crlcb.getMethod("to_der"));
- cX509CRL.defineMethod("to_pem",crlcb.getMethod("to_pem"));
- cX509CRL.defineMethod("to_s",crlcb.getMethod("to_pem"));
- cX509CRL.defineMethod("to_text",crlcb.getMethod("to_text"));
- cX509CRL.defineMethod("extensions",crlcb.getMethod("extensions"));
- cX509CRL.defineMethod("extensions=",crlcb.getMethod("set_extensions",IRubyObject.class));
- cX509CRL.defineMethod("add_extension",crlcb.getMethod("add_extension",IRubyObject.class));
+ cX509CRL.defineFastMethod("initialize_copy",crlcb.getFastMethod("initialize_copy",IRubyObject.class));
+ cX509CRL.defineFastMethod("clone",crlcb.getFastMethod("rbClone"));
+
+ cX509CRL.defineFastMethod("version",crlcb.getFastMethod("version"));
+ cX509CRL.defineFastMethod("version=",crlcb.getFastMethod("set_version",IRubyObject.class));
+ cX509CRL.defineFastMethod("signature_algorithm",crlcb.getFastMethod("signature_algorithm"));
+ cX509CRL.defineFastMethod("issuer",crlcb.getFastMethod("issuer"));
+ cX509CRL.defineFastMethod("issuer=",crlcb.getFastMethod("set_issuer",IRubyObject.class));
+ cX509CRL.defineFastMethod("last_update",crlcb.getFastMethod("last_update"));
+ cX509CRL.defineFastMethod("last_update=",crlcb.getFastMethod("set_last_update",IRubyObject.class));
+ cX509CRL.defineFastMethod("next_update",crlcb.getFastMethod("next_update"));
+ cX509CRL.defineFastMethod("next_update=",crlcb.getFastMethod("set_next_update",IRubyObject.class));
+ cX509CRL.defineFastMethod("revoked",crlcb.getFastMethod("revoked"));
+ cX509CRL.defineFastMethod("revoked=",crlcb.getFastMethod("set_revoked",IRubyObject.class));
+ cX509CRL.defineFastMethod("add_revoked",crlcb.getFastMethod("add_revoked",IRubyObject.class));
+
+ cX509CRL.defineFastMethod("sign",crlcb.getFastMethod("sign",IRubyObject.class,IRubyObject.class));
+ cX509CRL.defineFastMethod("verify",crlcb.getFastMethod("verify",IRubyObject.class));
+
+ cX509CRL.defineFastMethod("to_der",crlcb.getFastMethod("to_der"));
+ cX509CRL.defineFastMethod("to_pem",crlcb.getFastMethod("to_pem"));
+ cX509CRL.defineFastMethod("to_s",crlcb.getFastMethod("to_pem"));
+ cX509CRL.defineFastMethod("to_text",crlcb.getFastMethod("to_text"));
+ cX509CRL.defineFastMethod("extensions",crlcb.getFastMethod("extensions"));
+ cX509CRL.defineFastMethod("extensions=",crlcb.getFastMethod("set_extensions",IRubyObject.class));
+ cX509CRL.defineFastMethod("add_extension",crlcb.getFastMethod("add_extension",IRubyObject.class));
}
private IRubyObject version;
@@ -132,7 +133,7 @@ public X509CRL(IRuby runtime, RubyClass type) {
super(runtime,type);
}
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block block) throws Exception {
// System.err.println("WARNING: unimplemented method called: CRL#initialize");
extensions = new ArrayList();
if(checkArgumentCount(args,0,1) == 0) {
View
59 jruby/src/org/jruby/ext/openssl/X509Cert.java
@@ -56,6 +56,7 @@
import org.jruby.exceptions.RaiseException;
import org.jruby.ext.openssl.x509store.PEM;
import org.jruby.ext.openssl.x509store.X509AuxCertificate;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
@@ -78,34 +79,34 @@ public static void createX509Cert(IRuby runtime, RubyModule mX509) {
CallbackFactory certcb = runtime.callbackFactory(X509Cert.class);
cX509Cert.defineMethod("initialize",certcb.getOptMethod("_initialize"));
- cX509Cert.defineMethod("initialize_copy",certcb.getMethod("initialize_copy",IRubyObject.class));
- cX509Cert.defineMethod("clone",certcb.getMethod("rbClone"));
- cX509Cert.defineMethod("to_der",certcb.getMethod("to_der"));
- cX509Cert.defineMethod("to_pem",certcb.getMethod("to_pem"));
- cX509Cert.defineMethod("to_s",certcb.getMethod("to_pem"));
- cX509Cert.defineMethod("to_text",certcb.getMethod("to_text"));
- cX509Cert.defineMethod("version",certcb.getMethod("version"));
- cX509Cert.defineMethod("version=",certcb.getMethod("set_version",IRubyObject.class));
- cX509Cert.defineMethod("signature_algorithm",certcb.getMethod("signature_algorithm"));
- cX509Cert.defineMethod("serial",certcb.getMethod("serial"));
- cX509Cert.defineMethod("serial=",certcb.getMethod("set_serial",IRubyObject.class));
- cX509Cert.defineMethod("subject",certcb.getMethod("subject"));
- cX509Cert.defineMethod("subject=",certcb.getMethod("set_subject",IRubyObject.class));
- cX509Cert.defineMethod("issuer",certcb.getMethod("issuer"));
- cX509Cert.defineMethod("issuer=",certcb.getMethod("set_issuer",IRubyObject.class));
- cX509Cert.defineMethod("not_before",certcb.getMethod("not_before"));
- cX509Cert.defineMethod("not_before=",certcb.getMethod("set_not_before",IRubyObject.class));
- cX509Cert.defineMethod("not_after",certcb.getMethod("not_after"));
- cX509Cert.defineMethod("not_after=",certcb.getMethod("set_not_after",IRubyObject.class));
- cX509Cert.defineMethod("public_key",certcb.getMethod("public_key"));
- cX509Cert.defineMethod("public_key=",certcb.getMethod("set_public_key",IRubyObject.class));
- cX509Cert.defineMethod("sign",certcb.getMethod("sign",IRubyObject.class,IRubyObject.class));
- cX509Cert.defineMethod("verify",certcb.getMethod("verify",IRubyObject.class));
- cX509Cert.defineMethod("check_private_key",certcb.getMethod("check_private_key",IRubyObject.class));
- cX509Cert.defineMethod("extensions",certcb.getMethod("extensions"));
- cX509Cert.defineMethod("extensions=",certcb.getMethod("set_extensions",IRubyObject.class));
- cX509Cert.defineMethod("add_extension",certcb.getMethod("add_extension",IRubyObject.class));
- cX509Cert.defineMethod("inspect",certcb.getMethod("inspect"));
+ cX509Cert.defineFastMethod("initialize_copy",certcb.getFastMethod("initialize_copy",IRubyObject.class));
+ cX509Cert.defineFastMethod("clone",certcb.getFastMethod("rbClone"));
+ cX509Cert.defineFastMethod("to_der",certcb.getFastMethod("to_der"));
+ cX509Cert.defineFastMethod("to_pem",certcb.getFastMethod("to_pem"));
+ cX509Cert.defineFastMethod("to_s",certcb.getFastMethod("to_pem"));
+ cX509Cert.defineFastMethod("to_text",certcb.getFastMethod("to_text"));
+ cX509Cert.defineFastMethod("version",certcb.getFastMethod("version"));
+ cX509Cert.defineFastMethod("version=",certcb.getFastMethod("set_version",IRubyObject.class));
+ cX509Cert.defineFastMethod("signature_algorithm",certcb.getFastMethod("signature_algorithm"));
+ cX509Cert.defineFastMethod("serial",certcb.getFastMethod("serial"));
+ cX509Cert.defineFastMethod("serial=",certcb.getFastMethod("set_serial",IRubyObject.class));
+ cX509Cert.defineFastMethod("subject",certcb.getFastMethod("subject"));
+ cX509Cert.defineFastMethod("subject=",certcb.getFastMethod("set_subject",IRubyObject.class));
+ cX509Cert.defineFastMethod("issuer",certcb.getFastMethod("issuer"));
+ cX509Cert.defineFastMethod("issuer=",certcb.getFastMethod("set_issuer",IRubyObject.class));
+ cX509Cert.defineFastMethod("not_before",certcb.getFastMethod("not_before"));
+ cX509Cert.defineFastMethod("not_before=",certcb.getFastMethod("set_not_before",IRubyObject.class));
+ cX509Cert.defineFastMethod("not_after",certcb.getFastMethod("not_after"));
+ cX509Cert.defineFastMethod("not_after=",certcb.getFastMethod("set_not_after",IRubyObject.class));
+ cX509Cert.defineFastMethod("public_key",certcb.getFastMethod("public_key"));
+ cX509Cert.defineFastMethod("public_key=",certcb.getFastMethod("set_public_key",IRubyObject.class));
+ cX509Cert.defineFastMethod("sign",certcb.getFastMethod("sign",IRubyObject.class,IRubyObject.class));
+ cX509Cert.defineFastMethod("verify",certcb.getFastMethod("verify",IRubyObject.class));
+ cX509Cert.defineFastMethod("check_private_key",certcb.getFastMethod("check_private_key",IRubyObject.class));
+ cX509Cert.defineFastMethod("extensions",certcb.getFastMethod("extensions"));
+ cX509Cert.defineFastMethod("extensions=",certcb.getFastMethod("set_extensions",IRubyObject.class));
+ cX509Cert.defineFastMethod("add_extension",certcb.getFastMethod("add_extension",IRubyObject.class));
+ cX509Cert.defineFastMethod("inspect",certcb.getFastMethod("inspect"));
}
public X509Cert(IRuby runtime, RubyClass type) {
@@ -144,7 +145,7 @@ public static IRubyObject wrap(IRuby runtime, Certificate c) throws Exception {
return cr.callMethod(runtime.getCurrentContext(),"new",runtime.newString(new String(c.getEncoded(),"ISO8859_1")));
}
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block unusedBlock) throws Exception {
extensions = new ArrayList();
if(checkArgumentCount(args,0,1) == 0) {
return this;
View
31 jruby/src/org/jruby/ext/openssl/X509Extensions.java
@@ -54,6 +54,7 @@
import org.jruby.RubyObject;
import org.jruby.RubyString;
import org.jruby.exceptions.RaiseException;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
@@ -73,23 +74,23 @@ public static void createX509Ext(IRuby runtime, RubyModule mX509) {
cX509ExtFactory.attr_reader(new IRubyObject[]{runtime.newString("issuer_certificate"),runtime.newString("subject_certificate"),
runtime.newString("subject_request"),runtime.newString("crl"),
runtime.newString("config")});
- cX509ExtFactory.defineMethod("issuer_certificate=",extfcb.getMethod("set_issuer_cert",IRubyObject.class));
- cX509ExtFactory.defineMethod("subject_certificate=",extfcb.getMethod("set_subject_cert",IRubyObject.class));
- cX509ExtFactory.defineMethod("subject_request=",extfcb.getMethod("set_subject_req",IRubyObject.class));
- cX509ExtFactory.defineMethod("crl=",extfcb.getMethod("set_crl",IRubyObject.class));
- cX509ExtFactory.defineMethod("config=",extfcb.getMethod("set_config",IRubyObject.class));
- cX509ExtFactory.defineMethod("create_ext",extfcb.getOptMethod("create_ext"));
+ cX509ExtFactory.defineFastMethod("issuer_certificate=",extfcb.getFastMethod("set_issuer_cert",IRubyObject.class));
+ cX509ExtFactory.defineFastMethod("subject_certificate=",extfcb.getFastMethod("set_subject_cert",IRubyObject.class));
+ cX509ExtFactory.defineFastMethod("subject_request=",extfcb.getFastMethod("set_subject_req",IRubyObject.class));
+ cX509ExtFactory.defineFastMethod("crl=",extfcb.getFastMethod("set_crl",IRubyObject.class));
+ cX509ExtFactory.defineFastMethod("config=",extfcb.getFastMethod("set_config",IRubyObject.class));
+ cX509ExtFactory.defineFastMethod("create_ext",extfcb.getFastOptMethod("create_ext"));
RubyClass cX509Ext = mX509.defineClassUnder("Extension",runtime.getObject(),runtime.getObject().getAllocator());
CallbackFactory extcb = runtime.callbackFactory(Extension.class);
- cX509Ext.defineMethod("initialize",extcb.getOptMethod("_initialize"));
- cX509Ext.defineMethod("oid=",extcb.getMethod("set_oid",IRubyObject.class));
- cX509Ext.defineMethod("value=",extcb.getMethod("set_value",IRubyObject.class));
- cX509Ext.defineMethod("critical=",extcb.getMethod("set_critical",IRubyObject.class));
- cX509Ext.defineMethod("oid",extcb.getMethod("oid"));
- cX509Ext.defineMethod("value",extcb.getMethod("value"));
- cX509Ext.defineMethod("critical?",extcb.getMethod("critical_p"));
- cX509Ext.defineMethod("to_der",extcb.getMethod("to_der"));
+ cX509Ext.defineFastMethod("initialize",extcb.getFastOptMethod("_initialize"));
+ cX509Ext.defineFastMethod("oid=",extcb.getFastMethod("set_oid",IRubyObject.class));
+ cX509Ext.defineFastMethod("value=",extcb.getFastMethod("set_value",IRubyObject.class));
+ cX509Ext.defineFastMethod("critical=",extcb.getFastMethod("set_critical",IRubyObject.class));
+ cX509Ext.defineFastMethod("oid",extcb.getFastMethod("oid"));
+ cX509Ext.defineFastMethod("value",extcb.getFastMethod("value"));
+ cX509Ext.defineFastMethod("critical?",extcb.getFastMethod("critical_p"));
+ cX509Ext.defineFastMethod("to_der",extcb.getFastMethod("to_der"));
}
public static class ExtensionFactory extends RubyObject {
@@ -97,7 +98,7 @@ public ExtensionFactory(IRuby runtime, RubyClass type) {
super(runtime,type);
}
- public IRubyObject initialize(IRubyObject[] args) {
+ public IRubyObject initialize(IRubyObject[] args, Block unusedBlock) {
checkArgumentCount(args,0,4);
if(args.length > 0 && !args[0].isNil()) {
set_issuer_cert(args[0]);
View
19 jruby/src/org/jruby/ext/openssl/X509Name.java
@@ -55,6 +55,7 @@
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
import org.jruby.exceptions.RaiseException;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -77,14 +78,14 @@ public static void createX509Name(IRuby runtime, RubyModule mX509) {
CallbackFactory namecb = runtime.callbackFactory(X509Name.class);
cX509Name.defineMethod("initialize",namecb.getOptMethod("initialize"));
- cX509Name.defineMethod("add_entry",namecb.getOptMethod("add_entry"));
- cX509Name.defineMethod("to_s",namecb.getOptMethod("_to_s"));
- cX509Name.defineMethod("to_a",namecb.getMethod("to_a"));
- cX509Name.defineMethod("cmp",namecb.getMethod("cmp",IRubyObject.class));
- cX509Name.defineMethod("<=>",namecb.getMethod("cmp",IRubyObject.class));
- cX509Name.defineMethod("eql?",namecb.getMethod("eql_p",IRubyObject.class));
- cX509Name.defineMethod("hash",namecb.getMethod("hash"));
- cX509Name.defineMethod("to_der",namecb.getMethod("to_der"));
+ cX509Name.defineFastMethod("add_entry",namecb.getFastOptMethod("add_entry"));
+ cX509Name.defineFastMethod("to_s",namecb.getFastOptMethod("_to_s"));
+ cX509Name.defineFastMethod("to_a",namecb.getFastMethod("to_a"));
+ cX509Name.defineFastMethod("cmp",namecb.getFastMethod("cmp",IRubyObject.class));
+ cX509Name.defineFastMethod("<=>",namecb.getFastMethod("cmp",IRubyObject.class));
+ cX509Name.defineFastMethod("eql?",namecb.getFastMethod("eql_p",IRubyObject.class));
+ cX509Name.defineFastMethod("hash",namecb.getFastMethod("hash"));
+ cX509Name.defineFastMethod("to_der",namecb.getFastMethod("to_der"));
cX509Name.setConstant("COMPAT",runtime.newFixnum(COMPAT));
cX509Name.setConstant("RFC2253",runtime.newFixnum(RFC2253));
@@ -128,7 +129,7 @@ void addEntry(Object oid, Object value, Object type) {
types.add(type);
}
- public IRubyObject initialize(IRubyObject[] args) {
+ public IRubyObject initialize(IRubyObject[] args, Block unusedBlock) {
if(checkArgumentCount(args,0,2) == 0) {
return this;
}
View
17 jruby/src/org/jruby/ext/openssl/X509Revoked.java
@@ -31,6 +31,7 @@
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -53,13 +54,13 @@ public static void createX509Revoked(IRuby runtime, RubyModule mX509) {
CallbackFactory revcb = runtime.callbackFactory(X509Revoked.class);
cX509Rev.defineMethod("initialize",revcb.getOptMethod("_initialize"));
- cX509Rev.defineMethod("serial",revcb.getMethod("serial"));
- cX509Rev.defineMethod("serial=",revcb.getMethod("set_serial",IRubyObject.class));
- cX509Rev.defineMethod("time",revcb.getMethod("time"));
- cX509Rev.defineMethod("time=",revcb.getMethod("set_time",IRubyObject.class));
- cX509Rev.defineMethod("extensions",revcb.getMethod("extensions"));
- cX509Rev.defineMethod("extensions=",revcb.getMethod("set_extensions",IRubyObject.class));
- cX509Rev.defineMethod("add_extension",revcb.getMethod("add_extension",IRubyObject.class));
+ cX509Rev.defineFastMethod("serial",revcb.getFastMethod("serial"));
+ cX509Rev.defineFastMethod("serial=",revcb.getFastMethod("set_serial",IRubyObject.class));
+ cX509Rev.defineFastMethod("time",revcb.getFastMethod("time"));
+ cX509Rev.defineFastMethod("time=",revcb.getFastMethod("set_time",IRubyObject.class));
+ cX509Rev.defineFastMethod("extensions",revcb.getFastMethod("extensions"));
+ cX509Rev.defineFastMethod("extensions=",revcb.getFastMethod("set_extensions",IRubyObject.class));
+ cX509Rev.defineFastMethod("add_extension",revcb.getFastMethod("add_extension",IRubyObject.class));
}
private IRubyObject serial;
@@ -70,7 +71,7 @@ public X509Revoked(IRuby runtime, RubyClass type) {
super(runtime,type);
}
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block unusedBlock) throws Exception {
serial = getRuntime().getNil();
time = getRuntime().getNil();
extensions = getRuntime().newArray();
View
23 jruby/src/org/jruby/ext/openssl/X509Store.java
@@ -33,7 +33,6 @@
import org.jruby.RubyModule;
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
-import org.jruby.RubyProc;
import org.jruby.exceptions.RaiseException;
import org.jruby.ext.openssl.x509store.Function2;
import org.jruby.ext.openssl.x509store.X509AuxCertificate;
@@ -64,16 +63,16 @@ public static void createX509Store(IRuby runtime, RubyModule mX509) {
CallbackFactory storecb = runtime.callbackFactory(X509Store.class);
cX509Store.defineMethod("initialize",storecb.getOptMethod("_initialize"));
- cX509Store.defineMethod("verify_callback=",storecb.getMethod("set_verify_callback",IRubyObject.class));
- cX509Store.defineMethod("flags=",storecb.getMethod("set_flags",IRubyObject.class));
- cX509Store.defineMethod("purpose=",storecb.getMethod("set_purpose",IRubyObject.class));
- cX509Store.defineMethod("trust=",storecb.getMethod("set_trust",IRubyObject.class));
- cX509Store.defineMethod("time=",storecb.getMethod("set_time",IRubyObject.class));
- cX509Store.defineMethod("add_path",storecb.getMethod("add_path",IRubyObject.class));
- cX509Store.defineMethod("add_file",storecb.getMethod("add_file",IRubyObject.class));
- cX509Store.defineMethod("set_default_paths",storecb.getMethod("set_default_paths"));
- cX509Store.defineMethod("add_cert",storecb.getMethod("add_cert",IRubyObject.class));
- cX509Store.defineMethod("add_crl",storecb.getMethod("add_crl",IRubyObject.class));
+ cX509Store.defineFastMethod("verify_callback=",storecb.getFastMethod("set_verify_callback",IRubyObject.class));
+ cX509Store.defineFastMethod("flags=",storecb.getFastMethod("set_flags",IRubyObject.class));
+ cX509Store.defineFastMethod("purpose=",storecb.getFastMethod("set_purpose",IRubyObject.class));
+ cX509Store.defineFastMethod("trust=",storecb.getFastMethod("set_trust",IRubyObject.class));
+ cX509Store.defineFastMethod("time=",storecb.getFastMethod("set_time",IRubyObject.class));
+ cX509Store.defineFastMethod("add_path",storecb.getFastMethod("add_path",IRubyObject.class));
+ cX509Store.defineFastMethod("add_file",storecb.getFastMethod("add_file",IRubyObject.class));
+ cX509Store.defineFastMethod("set_default_paths",storecb.getFastMethod("set_default_paths"));
+ cX509Store.defineFastMethod("add_cert",storecb.getFastMethod("add_cert",IRubyObject.class));
+ cX509Store.defineFastMethod("add_crl",storecb.getFastMethod("add_crl",IRubyObject.class));
cX509Store.defineMethod("verify",storecb.getOptMethod("verify"));
X509StoreCtx.createX509StoreCtx(runtime, mX509);
@@ -99,7 +98,7 @@ private void raise(String msg) {
throw new RaiseException(getRuntime(),cStoreError, msg, true);
}
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block block) throws Exception {
store.set_verify_cb_func(ossl_verify_cb);
this.set_verify_callback(getRuntime().getNil());
this.setInstanceVariable("@flags",RubyFixnum.zero(getRuntime()));
View
29 jruby/src/org/jruby/ext/openssl/X509StoreCtx.java
@@ -41,6 +41,7 @@
import org.jruby.ext.openssl.x509store.X509AuxCertificate;
import org.jruby.ext.openssl.x509store.X509_STORE;
import org.jruby.ext.openssl.x509store.X509_STORE_CTX;
+import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
@@ -59,19 +60,19 @@ public static void createX509StoreCtx(IRuby runtime, RubyModule mX509) {
RubyClass cX509StoreContext = mX509.defineClassUnder("StoreContext",runtime.getObject(),X509STORECTX_ALLOCATOR);
CallbackFactory storectxcb = runtime.callbackFactory(X509StoreCtx.class);
cX509StoreContext.defineMethod("initialize",storectxcb.getOptMethod("_initialize"));
- cX509StoreContext.defineMethod("verify",storectxcb.getMethod("verify"));
- cX509StoreContext.defineMethod("chain",storectxcb.getMethod("chain"));
- cX509StoreContext.defineMethod("error",storectxcb.getMethod("error"));
- cX509StoreContext.defineMethod("error=",storectxcb.getMethod("set_error",IRubyObject.class));
- cX509StoreContext.defineMethod("error_string",storectxcb.getMethod("error_string"));
- cX509StoreContext.defineMethod("error_depth",storectxcb.getMethod("error_depth"));
- cX509StoreContext.defineMethod("current_cert",storectxcb.getMethod("current_cert"));
- cX509StoreContext.defineMethod("current_crl",storectxcb.getMethod("current_crl"));
- cX509StoreContext.defineMethod("cleanup",storectxcb.getMethod("cleanup"));
- cX509StoreContext.defineMethod("flags=",storectxcb.getMethod("set_flags",IRubyObject.class));
- cX509StoreContext.defineMethod("purpose=",storectxcb.getMethod("set_purpose",IRubyObject.class));
- cX509StoreContext.defineMethod("trust=",storectxcb.getMethod("set_trust",IRubyObject.class));
- cX509StoreContext.defineMethod("time=",storectxcb.getMethod("set_time",IRubyObject.class));
+ cX509StoreContext.defineFastMethod("verify",storectxcb.getFastMethod("verify"));
+ cX509StoreContext.defineFastMethod("chain",storectxcb.getFastMethod("chain"));
+ cX509StoreContext.defineFastMethod("error",storectxcb.getFastMethod("error"));
+ cX509StoreContext.defineFastMethod("error=",storectxcb.getFastMethod("set_error",IRubyObject.class));
+ cX509StoreContext.defineFastMethod("error_string",storectxcb.getFastMethod("error_string"));
+ cX509StoreContext.defineFastMethod("error_depth",storectxcb.getFastMethod("error_depth"));
+ cX509StoreContext.defineFastMethod("current_cert",storectxcb.getFastMethod("current_cert"));
+ cX509StoreContext.defineFastMethod("current_crl",storectxcb.getFastMethod("current_crl"));
+ cX509StoreContext.defineFastMethod("cleanup",storectxcb.getFastMethod("cleanup"));
+ cX509StoreContext.defineFastMethod("flags=",storectxcb.getFastMethod("set_flags",IRubyObject.class));
+ cX509StoreContext.defineFastMethod("purpose=",storectxcb.getFastMethod("set_purpose",IRubyObject.class));
+ cX509StoreContext.defineFastMethod("trust=",storectxcb.getFastMethod("set_trust",IRubyObject.class));
+ cX509StoreContext.defineFastMethod("time=",storectxcb.getFastMethod("set_time",IRubyObject.class));
}
private X509_STORE_CTX ctx;
@@ -89,7 +90,7 @@ private void raise(String msg) {
throw new RaiseException(getRuntime(),cStoreError, msg, true);
}
- public IRubyObject _initialize(IRubyObject[] args) throws Exception {
+ public IRubyObject _initialize(IRubyObject[] args, Block block) throws Exception {
IRubyObject store;
IRubyObject cert = getRuntime().getNil();
IRubyObject chain = getRuntime().getNil();
View
4 jruby/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
@@ -104,7 +104,7 @@ protected void initializeClass() {
defineFastMethod("include?", Arity.singleArgument(), "include");
defineFastMethod("index", Arity.optional());
defineMethod("initialize", Arity.optional(), "initialize");
- defineMethod("initialize_copy", Arity.singleArgument(), "replace");
+ defineFastMethod("initialize_copy", Arity.singleArgument(), "replace");
defineFastMethod("insert", Arity.twoArguments());
defineFastMethod("inspect", Arity.noArguments());
defineFastMethod("length", Arity.noArguments());
@@ -113,7 +113,7 @@ protected void initializeClass() {
defineFastMethod("lstrip!", Arity.noArguments(), "lstrip_bang");
defineFastMethod("match", Arity.singleArgument(), "match3");
defineFastMethod("oct", Arity.noArguments());
- defineMethod("replace", Arity.singleArgument());
+ defineFastMethod("replace", Arity.singleArgument());
defineFastMethod("reverse", Arity.noArguments());
defineFastMethod("reverse!", Arity.noArguments(), "reverse_bang");
defineFastMethod("rindex", Arity.optional());
View
2  jruby/src/org/jruby/runtime/builtin/meta/TimeMetaClass.java
@@ -117,7 +117,7 @@ protected void initializeClass() {
defineAlias("gmtime?", "gmt?");
defineFastMethod("localtime", Arity.noArguments());
defineFastMethod("hash", Arity.noArguments());
- defineMethod("initialize_copy", Arity.singleArgument());
+ defineFastMethod("initialize_copy", Arity.singleArgument());
defineMethod("_dump", Arity.optional(),"dump");
defineFastMethod("gmt_offset", Arity.noArguments());
defineAlias("gmtoff", "gmt_offset");
Please sign in to comment.
Something went wrong with that request. Please try again.