From b2b83e510b81457ffb66f2ecb3f58a6f959f48ad Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Fri, 13 Sep 2024 08:01:49 -0400 Subject: [PATCH] Update Ruby 3.1 patch; Remove GetConfig --- .../ruby_3_1/aws-lc-ruby-temp.patch | 52 +++++++++++++++---- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/tests/ci/integration/ruby_patch/ruby_3_1/aws-lc-ruby-temp.patch b/tests/ci/integration/ruby_patch/ruby_3_1/aws-lc-ruby-temp.patch index b4f84ec3d5..9882d14cd1 100644 --- a/tests/ci/integration/ruby_patch/ruby_3_1/aws-lc-ruby-temp.patch +++ b/tests/ci/integration/ruby_patch/ruby_3_1/aws-lc-ruby-temp.patch @@ -1,3 +1,20 @@ +From 74a05634822493182094618aa502be8bca00fbda Mon Sep 17 00:00:00 2001 +From: Justin Smith +Date: Fri, 13 Sep 2024 07:59:49 -0400 +Subject: [PATCH] Patch out GetConfig + +--- + ext/openssl/ossl_config.c | 8 ++++++++ + ext/openssl/ossl_config.h | 3 +++ + ext/openssl/ossl_ocsp.c | 16 ++++++++++------ + ext/openssl/ossl_pkcs7.c | 8 ++++++++ + ext/openssl/ossl_pkcs7.h | 2 ++ + ext/openssl/ossl_pkey.c | 32 ++++++++++++++++---------------- + ext/openssl/ossl_pkey_ec.c | 4 ++-- + ext/openssl/ossl_x509.c | 4 ++-- + ext/openssl/ossl_x509ext.c | 2 +- + 9 files changed, 52 insertions(+), 27 deletions(-) + diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c index 0bac027..7d499a0 100644 --- a/ext/openssl/ossl_config.c @@ -130,7 +147,7 @@ index 3e1b094..f85efcc 100644 void Init_ossl_pkcs7(void); diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c -index 4aa4489..be5769c 100644 +index 4aa4489..c7790aa 100644 --- a/ext/openssl/ossl_pkey.c +++ b/ext/openssl/ossl_pkey.c @@ -710,23 +710,23 @@ ossl_pkey_export_traditional(int argc, VALUE *argv, VALUE self, int to_der) @@ -144,7 +161,14 @@ index 4aa4489..be5769c 100644 -#else - char pem_str[80]; - const char *aname; -- ++// #if OPENSSL_VERSION_NUMBER >= 0x10100000 ++// if (!PEM_write_bio_PrivateKey_traditional(bio, pkey, enc, NULL, 0, ++// ossl_pem_passwd_cb, ++// (void *)pass)) { ++// #else ++// char pem_str[80]; ++// const char *aname; + - EVP_PKEY_asn1_get0_info(NULL, NULL, NULL, NULL, &aname, pkey->ameth); - snprintf(pem_str, sizeof(pem_str), "%s PRIVATE KEY", aname); - if (!PEM_ASN1_write_bio((i2d_of_void *)i2d_PrivateKey, pem_str, bio, @@ -154,14 +178,6 @@ index 4aa4489..be5769c 100644 - BIO_free(bio); - ossl_raise(ePKeyError, "PEM_write_bio_PrivateKey_traditional"); - } -+// #if OPENSSL_VERSION_NUMBER >= 0x10100000 -+// if (!PEM_write_bio_PrivateKey_traditional(bio, pkey, enc, NULL, 0, -+// ossl_pem_passwd_cb, -+// (void *)pass)) { -+// #else -+// char pem_str[80]; -+// const char *aname; -+ +// EVP_PKEY_asn1_get0_info(NULL, NULL, NULL, NULL, &aname, pkey->ameth); +// snprintf(pem_str, sizeof(pem_str), "%s PRIVATE KEY", aname); +// if (!PEM_ASN1_write_bio((i2d_of_void *)i2d_PrivateKey, pem_str, bio, @@ -211,3 +227,19 @@ index f847070..53b6270 100644 DefX509Const(TRUST_TSA); DefX509Default(CERT_AREA, cert_area); +diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c +index e54102c..b6658e7 100644 +--- a/ext/openssl/ossl_x509ext.c ++++ b/ext/openssl/ossl_x509ext.c +@@ -226,7 +226,7 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self) + GetX509ExtFactory(self, ctx); + obj = NewX509Ext(cX509Ext); + rconf = rb_iv_get(self, "@config"); +- conf = NIL_P(rconf) ? NULL : GetConfig(rconf); ++ conf = NULL; + X509V3_set_nconf(ctx, conf); + ext = X509V3_EXT_nconf_nid(conf, ctx, nid, RSTRING_PTR(valstr)); + X509V3_set_ctx_nodb(ctx); +-- +2.39.3 (Apple Git-145) +