Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/main/java/org/jruby/ext/openssl/ASN1.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ static ASN1ObjectIdentifier getObjectID(final Ruby runtime, final String nameOrO
return new ASN1ObjectIdentifier( nameOrOid );
}

static ASN1ObjectIdentifier toObjectID(final String oid, final boolean silent)
private static ASN1ObjectIdentifier toObjectID(final String oid, final boolean silent)
throws IllegalArgumentException {
try {
return new ASN1ObjectIdentifier(oid);
Expand All @@ -766,6 +766,11 @@ static ASN1ObjectIdentifier toObjectID(final String oid, final boolean silent)
}
}

static String shortName(final Ruby runtime, final ASN1ObjectIdentifier oid) {
final String name = oid2name(runtime, oid, true);
return name == null ? oid.getId() : name;
}

@JRubyMethod(name="Boolean", module=true, rest=true)
public static IRubyObject fact_Boolean(ThreadContext context, IRubyObject self, IRubyObject[] args) {
return newInstance(context, self, "Boolean", args);
Expand Down Expand Up @@ -1554,7 +1559,7 @@ boolean isEoc() {
}

public static RaiseException newASN1Error(Ruby runtime, String message) {
return newError(runtime, _ASN1(runtime).getClass("ASN1Error"), message, false);
return newError(runtime, _ASN1Error(runtime), message, false);
}

static RaiseException newASN1Error(Ruby runtime, Throwable ex) {
Expand All @@ -1565,6 +1570,10 @@ static RubyModule _ASN1(final Ruby runtime) {
return (RubyModule) runtime.getModule("OpenSSL").getConstant("ASN1");
}

static RubyClass _ASN1Error(final Ruby runtime) {
return _ASN1(runtime).getClass("ASN1Error");
}

static org.bouncycastle.asn1.ASN1Primitive readObject(final byte[] bytes)
throws IOException {
return new ASN1InputStream(new ByteArrayInputStream(bytes)).readObject();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jruby/ext/openssl/OpenSSL.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public static void createOpenSSL(final Ruby runtime) {
PKCS5.createPKCS5(runtime, _OpenSSL);
OCSP.createOCSP(runtime, _OpenSSL, OpenSSLError);
KDF.createKDF(runtime, _OpenSSL, OpenSSLError);
Timestamp.createTimestamp(runtime, _OpenSSL, OpenSSLError);

runtime.getLoadService().require("jopenssl/version");

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jruby/ext/openssl/PKCS7.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ public IRubyObject initialize(final ThreadContext context, IRubyObject[] args) {
}
return this;
}

IRubyObject arg = to_der_if_possible(context, args[0]);
BIO input = obj2bio(context, arg);
try {
Expand Down
Loading
Loading