Permalink
Browse files

Eliminate a few deprecation warnings from OpenSSL.

  • Loading branch information...
1 parent af3d582 commit 4f0b7811cb8ceb7feeaca288fdef238d542db2e2 @headius headius committed May 18, 2012
@@ -56,8 +56,8 @@ public IRubyObject allocate(Ruby runtime, RubyClass klass) {
public static void createDigest(Ruby runtime, RubyModule mOSSL) {
runtime.getLoadService().require("digest");
- RubyModule mDigest = runtime.fastGetModule("Digest");
- RubyClass cDigestClass = mDigest.fastGetClass("Class");
+ RubyModule mDigest = runtime.getModule("Digest");
+ RubyClass cDigestClass = mDigest.getClass("Class");
RubyClass cDigest = mOSSL.defineClassUnder("Digest", cDigestClass, DIGEST_ALLOCATOR);
cDigest.defineAnnotatedMethods(Digest.class);
RubyClass openSSLError = mOSSL.getClass("OpenSSLError");
@@ -146,7 +146,7 @@ public IRubyObject initialize_copy(IRubyObject obj) {
@JRubyMethod(name={"update","<<"})
public IRubyObject update(IRubyObject obj) {
ByteList bytes = obj.convertToString().getByteList();
- algo.update(bytes.bytes, bytes.begin, bytes.realSize);
+ algo.update(bytes.unsafeBytes(), bytes.begin(), bytes.getRealSize());
return this;
}
@@ -115,7 +115,7 @@ public static BIO obj2bio(IRubyObject obj) {
} else {
RubyString str = obj.convertToString();
ByteList bl = str.getByteList();
- return BIO.memBuf(bl.bytes, bl.begin, bl.realSize);
+ return BIO.memBuf(bl.unsafeBytes(), bl.begin(), bl.getRealSize());
}
}
@@ -44,6 +44,7 @@
import org.jruby.anno.JRubyMethod;
import org.jruby.exceptions.RaiseException;
import org.jruby.runtime.ObjectAllocator;
+import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
/**
@@ -76,7 +77,7 @@ public PKey(Ruby runtime, RubyClass type) {
@Override
@JRubyMethod
- public IRubyObject initialize() {
+ public IRubyObject initialize(ThreadContext context) {
return this;
}
@@ -159,7 +159,7 @@ public IRubyObject add_file(IRubyObject arg) {
@JRubyMethod
public IRubyObject set_default_paths() {
try {
- RubyHash env = (RubyHash)getRuntime().getObject().fastGetConstant("ENV");
+ RubyHash env = (RubyHash)getRuntime().getObject().getConstant("ENV");
String file = (String)env.get(getRuntime().newString(X509Utils.getDefaultCertificateFileEnvironment()));
store.loadLocations(file, null);
String path = (String)env.get(getRuntime().newString(X509Utils.getDefaultCertificateDirectoryEnvironment()));

0 comments on commit 4f0b781

Please sign in to comment.