Improve build and fix X509 test failures for Ruby #1887
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues:
Resolves
CryptoAlg-2701
Description of changes:
bignum_to_string
is called when trying to print out the X509 Extension value. Initially I thought the value wasn't being set correctly, but it turns out that we were printing the value in hex form, rather than decimal (which OpenSSL does and Ruby expects). AWS-LC prints the hex value if the value is more than 32 bits, while OpenSSL has a much more lax restriction at 128 bits. Tweaking this to align with OpenSSL gets past the test fortest_x509crl.rb
. Tweaking the value to align with OpenSSL gets past the test.aws-lc/crypto/x509/v3_utl.c
Lines 168 to 175 in 8ed554c
Great news is I don't think we need to do anything for the test failure in
test_x509req
. This was a testing mistake on Ruby's end, documented in this commit: ruby/ruby@6b12013Only version 1 is available for CSRs and Ruby attempts to set an invalid version in its tests. OpenSSL 3.3 disallows this behavior now and Ruby has removed the test in it's mainline branch. We can brush up the patch to account for this and skip the test with AWS-LC.
I also took the chance to add back some of the defines Ruby depends on as no-ops. The X509 defines aren't actually used in neither OpenSSL or AWS-LC as found by this commit: 496838a
Call-outs:
N/A
Testing:
N/A
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.