From 64cadf04624be71dc6bbc517e532a2d9957fd1b8 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 8b7b2b54..b2efe10c 100644 --- a/src/main/java/org/jruby/ext/openssl/ASN1.java +++ b/src/main/java/org/jruby/ext/openssl/ASN1.java @@ -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 ) {