From 589bcd00e6e401c185395f2db4d2ec9af45ba89f Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Tue, 24 Oct 2023 11:35:33 -0700 Subject: [PATCH] Prefer ASN1*Strings over DER*Strings in ASN1.java --- src/main/java/org/jruby/ext/openssl/ASN1.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jruby/ext/openssl/ASN1.java b/src/main/java/org/jruby/ext/openssl/ASN1.java index f2bb0cde..d89bc950 100644 --- a/src/main/java/org/jruby/ext/openssl/ASN1.java +++ b/src/main/java/org/jruby/ext/openssl/ASN1.java @@ -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 ) {