Navigation Menu

Skip to content

Commit

Permalink
Revert "Fix PEM format parsing of CSR"
Browse files Browse the repository at this point in the history
This reverts commit d88b4ac.

The commit seems to include printf debugging. Please supply us a fix
with test...
  • Loading branch information
Hiroshi Nakamura committed Apr 30, 2012
1 parent fe35ac1 commit 1e037fa
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions src/java/org/jruby/ext/openssl/Request.java
Expand Up @@ -138,26 +138,15 @@ public Object call() throws GeneralSecurityException {
}
ASN1Set in_attrs = req.getCertificationRequestInfo().getAttributes();
for(Enumeration enm = in_attrs.getObjects();enm.hasMoreElements();) {
Object o = enm.nextElement();
System.out.println("enm: " + o.getClass());
if (o instanceof DERSequence) {
DERSequence val = (DERSequence)o;
DERObjectIdentifier v0 = (DERObjectIdentifier)val.getObjectAt(0);
DERObject v1 = (DERObject)val.getObjectAt(1);
IRubyObject a1 = getRuntime().newString(ASN1.getSymLookup(getRuntime()).get(v0));
IRubyObject a2 = ASN1.decode(getRuntime().getClassFromPath("OpenSSL::ASN1"), RubyString.newString(getRuntime(), v1.getDEREncoded()));
add_attribute(Utils.newRubyInstance(getRuntime(), "OpenSSL::X509::Attribute", new IRubyObject[] { a1, a2 }));
} else {
DERSet obj = (DERSet)o;
for(Enumeration enm2 = obj.getObjects();enm2.hasMoreElements();) {
DERSequence val = (DERSequence)enm2.nextElement();
DERObjectIdentifier v0 = (DERObjectIdentifier)val.getObjectAt(0);
DERObject v1 = (DERObject)val.getObjectAt(1);
IRubyObject a1 = getRuntime().newString(ASN1.getSymLookup(getRuntime()).get(v0));
IRubyObject a2 = ASN1.decode(getRuntime().getClassFromPath("OpenSSL::ASN1"), RubyString.newString(getRuntime(), v1.getDEREncoded()));
add_attribute(Utils.newRubyInstance(getRuntime(), "OpenSSL::X509::Attribute", new IRubyObject[] { a1, a2 }));
}
}
DERSet obj = (DERSet)enm.nextElement();
for(Enumeration enm2 = obj.getObjects();enm2.hasMoreElements();) {
DERSequence val = (DERSequence)enm2.nextElement();
DERObjectIdentifier v0 = (DERObjectIdentifier)val.getObjectAt(0);
DERObject v1 = (DERObject)val.getObjectAt(1);
IRubyObject a1 = getRuntime().newString(ASN1.getSymLookup(getRuntime()).get(v0));
IRubyObject a2 = ASN1.decode(getRuntime().getClassFromPath("OpenSSL::ASN1"), RubyString.newString(getRuntime(), v1.getDEREncoded()));
add_attribute(Utils.newRubyInstance(getRuntime(), "OpenSSL::X509::Attribute", new IRubyObject[] { a1, a2 }));
}
}
this.valid = true;
return this;
Expand Down

0 comments on commit 1e037fa

Please sign in to comment.