Skip to content

Commit 1e037fa

Browse files
author
Hiroshi Nakamura
committed
Revert "Fix PEM format parsing of CSR"
This reverts commit d88b4ac. The commit seems to include printf debugging. Please supply us a fix with test...
1 parent fe35ac1 commit 1e037fa

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

src/java/org/jruby/ext/openssl/Request.java

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -138,26 +138,15 @@ public Object call() throws GeneralSecurityException {
138138
}
139139
ASN1Set in_attrs = req.getCertificationRequestInfo().getAttributes();
140140
for(Enumeration enm = in_attrs.getObjects();enm.hasMoreElements();) {
141-
Object o = enm.nextElement();
142-
System.out.println("enm: " + o.getClass());
143-
if (o instanceof DERSequence) {
144-
DERSequence val = (DERSequence)o;
145-
DERObjectIdentifier v0 = (DERObjectIdentifier)val.getObjectAt(0);
146-
DERObject v1 = (DERObject)val.getObjectAt(1);
147-
IRubyObject a1 = getRuntime().newString(ASN1.getSymLookup(getRuntime()).get(v0));
148-
IRubyObject a2 = ASN1.decode(getRuntime().getClassFromPath("OpenSSL::ASN1"), RubyString.newString(getRuntime(), v1.getDEREncoded()));
149-
add_attribute(Utils.newRubyInstance(getRuntime(), "OpenSSL::X509::Attribute", new IRubyObject[] { a1, a2 }));
150-
} else {
151-
DERSet obj = (DERSet)o;
152-
for(Enumeration enm2 = obj.getObjects();enm2.hasMoreElements();) {
153-
DERSequence val = (DERSequence)enm2.nextElement();
154-
DERObjectIdentifier v0 = (DERObjectIdentifier)val.getObjectAt(0);
155-
DERObject v1 = (DERObject)val.getObjectAt(1);
156-
IRubyObject a1 = getRuntime().newString(ASN1.getSymLookup(getRuntime()).get(v0));
157-
IRubyObject a2 = ASN1.decode(getRuntime().getClassFromPath("OpenSSL::ASN1"), RubyString.newString(getRuntime(), v1.getDEREncoded()));
158-
add_attribute(Utils.newRubyInstance(getRuntime(), "OpenSSL::X509::Attribute", new IRubyObject[] { a1, a2 }));
159-
}
160-
}
141+
DERSet obj = (DERSet)enm.nextElement();
142+
for(Enumeration enm2 = obj.getObjects();enm2.hasMoreElements();) {
143+
DERSequence val = (DERSequence)enm2.nextElement();
144+
DERObjectIdentifier v0 = (DERObjectIdentifier)val.getObjectAt(0);
145+
DERObject v1 = (DERObject)val.getObjectAt(1);
146+
IRubyObject a1 = getRuntime().newString(ASN1.getSymLookup(getRuntime()).get(v0));
147+
IRubyObject a2 = ASN1.decode(getRuntime().getClassFromPath("OpenSSL::ASN1"), RubyString.newString(getRuntime(), v1.getDEREncoded()));
148+
add_attribute(Utils.newRubyInstance(getRuntime(), "OpenSSL::X509::Attribute", new IRubyObject[] { a1, a2 }));
149+
}
161150
}
162151
this.valid = true;
163152
return this;

0 commit comments

Comments
 (0)