Skip to content

Support encode or decode ∞ like OpenSSL#1930

Merged
samuel40791765 merged 2 commits intoaws:mainfrom
samuel40791765:infinity-fix
Oct 28, 2024
Merged

Support encode or decode ∞ like OpenSSL#1930
samuel40791765 merged 2 commits intoaws:mainfrom
samuel40791765:infinity-fix

Conversation

@samuel40791765
Copy link
Copy Markdown
Contributor

@samuel40791765 samuel40791765 commented Oct 18, 2024

Issues:

Addresses CryptoAlg-2697

Description of changes:

Ruby has tests asserting that OpenSSL encodes and decodes infinity points to 0. This doesn't quite make sense, but our hand is sort of forced here. It does show that there's dependence on this subtle behavior and we might as well support it since we're trying to gain better compatibility.

    assert_equal false, point.infinity?
    point.set_to_infinity!
    assert_equal true, point.infinity?
    assert_equal 0.to_bn, point.to_bn
    assert_equal B(%w{ 00 }), point.to_octet_string(:uncompressed)
    assert_equal true, point.on_curve?

Call-outs:

Tweak against changes from these commits;

Testing:

Tweaked existing tests that checked we did not support this behavior.

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.

@samuel40791765 samuel40791765 requested a review from a team as a code owner October 18, 2024 00:32
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.66%. Comparing base (b77a698) to head (a9a7100).

Files with missing lines Patch % Lines
crypto/fipsmodule/ec/oct.c 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1930      +/-   ##
==========================================
- Coverage   78.68%   78.66%   -0.03%     
==========================================
  Files         585      585              
  Lines      100854   100867      +13     
  Branches    14298    14303       +5     
==========================================
- Hits        79357    79342      -15     
- Misses      20863    20889      +26     
- Partials      634      636       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

justsmth
justsmth previously approved these changes Oct 18, 2024
dkostic
dkostic previously approved these changes Oct 25, 2024
@samuel40791765 samuel40791765 merged commit de33f5e into aws:main Oct 28, 2024
@samuel40791765 samuel40791765 deleted the infinity-fix branch October 28, 2024 20:57
skmcgrail added a commit that referenced this pull request Nov 7, 2024
## What's Changed
* 800-131Ar1: length of the key-derivation key shall be at least 112
bits. by @skmcgrail in #1924
* Marshalling/Unmarshalling DH public keys by @justsmth in
#1916
* Also prune SSM documents from ec2-test-framework by @samuel40791765 in
#1925
* Use illegal_parameter instead of decode_error for invalid key shares
by @justsmth in #1923
* Add null check in dh testing by @torben-hansen in
#1937
* DH paramgen callback by @justsmth in
#1928
* Upstream merge 2024 10 17 by @torben-hansen in
#1934
* Remove old Intel CPU types by @justsmth in
#1942
* Remove retries on PCT failure in EC and RSA key generation. by @nebeid
in #1938
* Add p4p, bump up time by @justsmth in
#1943
* PQ README by @jakemas in #1932
* bump mysql CI to 9.1.0 by @justsmth in
#1939
* HKDF, HKDF_expand, and PBKDF Truncated SHA2-512 by @skmcgrail in
#1946
* Missing functionality + Adding Nmap to our CI by @smittals2 in
#1915
* Fix FIPS.md typo by @justsmth in
#1950
* Support encode or decode ∞ like OpenSSL by @samuel40791765 in
#1930
* Expand support for EVP_PKEY_HMAC by @justsmth in
#1933
* Add PKCS7-internal BIO_f_cipher by @WillChilds-Klein in
#1836
* Add PKCS7-internal BIO_f_md by @WillChilds-Klein in
#1886
* Ruby Support - DSA custom md by @justsmth in
#1953
* Add support for POINT_CONVERSION_HYBRID by @samuel40791765 in
#1936
* Fixes for Coverity Alerts by @smittals2 in
#1960
* Also test w/ gcc 4.8 by @justsmth in
#1962
* Actually add support for SSL_get_server/peer_tmp_key by
@samuel40791765 in #1945
* Coverity Fix Null Check by @smittals2 in
#1965
* ML-KEM keygen Pairwise Consistency Test by @dkostic in
#1964
* EDDSA PCT by @torben-hansen in #1968
* Expose AES_cfb1_encrypt and AES_cfb8_encrypt by @skmcgrail in
#1967

**Full Changelog**:
v1.37.0...v1.38.0

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants