Skip to content

Commit 3e5b965

Browse files
authored
Merge pull request #2255 from ksss/openssl
Fix OpenSSL::PKey::{RSA,DSA,DH}#params return type
2 parents d59f43a + fb25196 commit 3e5b965

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

stdlib/openssl/0/openssl.rbs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,7 @@ module OpenSSL
19071907
# negative number.
19081908
#
19091909
def initialize: (instance) -> void
1910-
| (int) -> void
1910+
| (Integer) -> void
19111911
| (string) -> void
19121912
| (string, 0 | 2 | 10 | 16) -> void
19131913

@@ -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

+6-1
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)