Skip to content

Commit fb25196

Browse files
committed
Fix OpenSSL::PKey::{RSA,DSA,DH}#params return type
Follow up to ruby/openssl#774
1 parent 34b3330 commit fb25196

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

stdlib/openssl/0/openssl.rbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5648,7 +5648,7 @@ module OpenSSL
56485648
# Stores all parameters of key to the hash INSECURE: PRIVATE INFORMATIONS CAN
56495649
# LEAK OUT!!! Don't use :-)) (I's up to you)
56505650
#
5651-
def params: () -> Hash[String, BN]
5651+
def params: () -> Hash[String, BN?]
56525652

56535653
# <!--
56545654
# rdoc-file=ext/openssl/ossl_pkey_dh.c
@@ -5942,7 +5942,7 @@ module OpenSSL
59425942
# Stores all parameters of key to the hash INSECURE: PRIVATE INFORMATIONS CAN
59435943
# LEAK OUT!!! Don't use :-)) (I's up to you)
59445944
#
5945-
def params: () -> Hash[String, BN]
5945+
def params: () -> Hash[String, BN?]
59465946

59475947
def priv_key: () -> BN
59485948

@@ -7220,7 +7220,7 @@ module OpenSSL
72207220
#
72217221
# Don't use :-)) (It's up to you)
72227222
#
7223-
def params: () -> Hash[String, BN]
7223+
def params: () -> Hash[String, BN?]
72247224

72257225
# <!--
72267226
# rdoc-file=ext/openssl/ossl_pkey_rsa.c

test/stdlib/OpenSSL_test.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def test_export
699699
end
700700

701701
def test_params
702-
assert_send_type "() -> Hash[String, OpenSSL::BN]",
702+
assert_send_type "() -> Hash[String, OpenSSL::BN?]",
703703
pkey, :params
704704
end
705705

@@ -916,6 +916,11 @@ def test_sign_and_verify
916916
pkey, :verify, digest, sig, data
917917
end
918918

919+
def test_params
920+
assert_send_type "() -> Hash[String, OpenSSL::BN]",
921+
pkey, :params
922+
end
923+
919924
private
920925

921926
def pkey

0 commit comments

Comments
 (0)