Skip to content

Commit

Permalink
Prefer ASN1*Strings over DER*Strings in ASN1.java
Browse files Browse the repository at this point in the history
  • Loading branch information
justinstoller committed Oct 24, 2023
1 parent 491f1eb commit 589bcd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/jruby/ext/openssl/ASN1.java
Original file line number Diff line number Diff line change
Expand Up @@ -1695,13 +1695,13 @@ ASN1Encodable toASN1(final ThreadContext context) {
}

if ( type == DERGeneralString.class ) {
return new DERGeneralString( val.asString().toString() );
return ASN1GeneralString.getInstance( val.asString().getBytes() );
}
if ( type == DERVisibleString.class ) {
return new DERVisibleString( val.asString().toString() );
return ASN1VisibleString.getInstance( val.asString().getBytes() );
}
if ( type == DERNumericString.class ) {
return new DERNumericString( val.asString().toString() );
return ASN1NumericString.getInstance( val.asString().getBytes() );
}

if ( val instanceof RubyString ) {
Expand Down

0 comments on commit 589bcd0

Please sign in to comment.