Skip to content

Commit 337241c

Browse files
committed
[fix] try hard not to fail on unkown oids
while doing OpenSSL::X509::Certificate#to_text
1 parent abd8ebe commit 337241c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/jruby/ext/openssl/X509CRL.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,11 @@ static void extensions_to_text(final ThreadContext context,
389389
for ( int i = 0; i < exts.size(); i++ ) {
390390
final X509Extension ext = exts.get(i);
391391
final ASN1ObjectIdentifier oid = ext.getRealObjectID();
392-
final String no = ASN1.o2a(context.runtime, oid);
392+
String no = ASN1.o2a(context.runtime, oid, true);
393+
if (no == null) { // MRI here just appends the OID string
394+
no = ASN1.oid2Sym(context.runtime, oid, true);
395+
if (no == null) no = oid.toString();
396+
}
393397
text.append(S20,0,indent).append( no ).append(": ");
394398
if ( ext.isRealCritical() ) text.append("critical");
395399
text.append('\n');

0 commit comments

Comments
 (0)