Skip to content

Commit b4a533a

Browse files
committed
Prefer ASN1*Strings over DER*Strings in ASN1.java
1 parent e5688f6 commit b4a533a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,13 +1697,13 @@ ASN1Encodable toASN1(final ThreadContext context) {
16971697
}
16981698

16991699
if ( type == DERGeneralString.class ) {
1700-
return new DERGeneralString( val.asString().toString() );
1700+
return ASN1GeneralString.getInstance( val.asString().getBytes() );
17011701
}
17021702
if ( type == DERVisibleString.class ) {
1703-
return new DERVisibleString( val.asString().toString() );
1703+
return ASN1VisibleString.getInstance( val.asString().getBytes() );
17041704
}
17051705
if ( type == DERNumericString.class ) {
1706-
return new DERNumericString( val.asString().toString() );
1706+
return ASN1NumericString.getInstance( val.asString().getBytes() );
17071707
}
17081708

17091709
if ( val instanceof RubyString ) {

0 commit comments

Comments
 (0)