aboutsummaryrefslogtreecommitdiffstats
path: root/test/openssl/test_ts.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-14 18:16:06 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-10-16 16:59:23 +0900
commitd60ded5afc7414bf9934e3bdbd523e3091a4d05e (patch)
tree1266ec804a2b46e3d51884eda6206de9828d21d7 /test/openssl/test_ts.rb
parent74d0cde6c8cff570b68c2541ec8e4fbc3738ab69 (diff)
downloadruby-openssl-d60ded5afc7414bf9934e3bdbd523e3091a4d05e.tar.gz
Fixed the results of OpenSSL::Timestamp::Response#failure_info
[ This is a backport to the 2.2 branch. ] Made stored values `Symbol`s instead of `ID`s. Fixes https://bugs.ruby-lang.org/issues/17625 Co-Authored-By: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com> (cherry picked from commit f2d004679a62408a89d7304b229c24e789b94776)
Diffstat (limited to 'test/openssl/test_ts.rb')
-rw-r--r--test/openssl/test_ts.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/openssl/test_ts.rb b/test/openssl/test_ts.rb
index da5f9006..7cb1a1fe 100644
--- a/test/openssl/test_ts.rb
+++ b/test/openssl/test_ts.rb
@@ -228,6 +228,11 @@ _end_of_pem_
assert_equal(token.to_der, resp.token.to_der)
end
+ def test_response_failure_info
+ resp = OpenSSL::Timestamp::Response.new("0\"0 \x02\x01\x020\x17\f\x15Invalid TimeStampReq.\x03\x02\x06\x80")
+ assert_equal(:BAD_ALG, resp.failure_info)
+ end
+
def test_response_mandatory_fields
fac = OpenSSL::Timestamp::Factory.new
req = OpenSSL::Timestamp::Request.new