Skip to content

Commit b7ee7e0

Browse files
committed
Merge branch 'maint-3.3'
* maint-3.3: Ruby/OpenSSL 3.3.2 Ruby/OpenSSL 3.2.3 Ruby/OpenSSL 3.1.3 Check NULL values for deprecated EVP_PKEY_get0() functions
2 parents cca981e + 632d6e6 commit b7ee7e0

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

History.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 3.3.2
2+
=============
3+
4+
Merged changes in 3.1.3 and 3.2.3.
5+
6+
17
Version 3.3.1
28
=============
39

@@ -80,6 +86,12 @@ And various non-user-visible changes and bug fixes. Please see the commit
8086
history for more details.
8187

8288

89+
Version 3.2.3
90+
=============
91+
92+
Merged changes in 3.1.3.
93+
94+
8395
Version 3.2.2
8496
=============
8597

@@ -132,6 +144,16 @@ Notable changes
132144
[[GitHub #141]](https://github.com/ruby/openssl/pull/141)
133145

134146

147+
Version 3.1.3
148+
=============
149+
150+
Bug fixes
151+
---------
152+
153+
* Fix missing NULL check for `EVP_PKEY_get0()` functions with OpenSSL 3.x.
154+
[[GitHub #957]](https://github.com/ruby/openssl/pull/957)
155+
156+
135157
Version 3.1.2
136158
=============
137159

ext/openssl/ossl_pkey_dh.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
EVP_PKEY *_pkey; \
2222
GetPKeyDH((obj), _pkey); \
2323
(dh) = EVP_PKEY_get0_DH(_pkey); \
24+
if ((dh) == NULL) \
25+
ossl_raise(eDHError, "failed to get DH from EVP_PKEY"); \
2426
} while (0)
2527

2628
/*

ext/openssl/ossl_pkey_dsa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
EVP_PKEY *_pkey; \
2222
GetPKeyDSA((obj), _pkey); \
2323
(dsa) = EVP_PKEY_get0_DSA(_pkey); \
24+
if ((dsa) == NULL) \
25+
ossl_raise(eDSAError, "failed to get DSA from EVP_PKEY"); \
2426
} while (0)
2527

2628
static inline int

ext/openssl/ossl_pkey_ec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ static const rb_data_type_t ossl_ec_point_type;
2222
EVP_PKEY *_pkey; \
2323
GetPKeyEC(obj, _pkey); \
2424
(key) = EVP_PKEY_get0_EC_KEY(_pkey); \
25+
if ((key) == NULL) \
26+
ossl_raise(eECError, "failed to get EC_KEY from EVP_PKEY"); \
2527
} while (0)
2628

2729
#define GetECGroup(obj, group) do { \

ext/openssl/ossl_pkey_rsa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
EVP_PKEY *_pkey; \
2222
GetPKeyRSA((obj), _pkey); \
2323
(rsa) = EVP_PKEY_get0_RSA(_pkey); \
24+
if ((rsa) == NULL) \
25+
ossl_raise(eRSAError, "failed to get RSA from EVP_PKEY"); \
2426
} while (0)
2527

2628
static inline int

0 commit comments

Comments
 (0)