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 Apr 17, 2024
1 parent eb3d906 commit 64cadf0
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 @@ -1697,13 +1697,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 64cadf0

Please sign in to comment.