Skip to content

crypto: Fix DH private key length type mismatch - #11513

Open
ruslandoga wants to merge 1 commit into
erlang:maintfrom
ruslandoga:crypto/dh-uint64-fix
Open

crypto: Fix DH private key length type mismatch#11513
ruslandoga wants to merge 1 commit into
erlang:maintfrom
ruslandoga:crypto/dh-uint64-fix

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

enif_get_uint64() writes through an ErlNifUInt64 *, while
OSSL_PARAM_construct_uint64() builds a parameter pointing to uint64_t
storage. On macOS arm64, those are equally wide but distinct C types:
ErlNifUInt64 is unsigned long, while uint64_t is unsigned long long.

Fixes #11511

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

  2 files   14 suites   4m 25s ⏱️
195 tests 177 ✅  18 💤 0 ❌
497 runs  346 ✅ 151 💤 0 ❌

Results for commit 74edf11.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@ruslandoga
ruslandoga marked this pull request as ready for review August 19, 2026 14:28
@ruslandoga
ruslandoga force-pushed the crypto/dh-uint64-fix branch from 4ae7e50 to 3a813ec Compare August 20, 2026 13:01
@Mikaka27

Copy link
Copy Markdown
Contributor

Could you rebase the branch from patch-base-27 tag?

@Mikaka27 Mikaka27 self-assigned this Aug 21, 2026
@Mikaka27 Mikaka27 added the team:PS Assigned to OTP team PS label Aug 21, 2026
@ruslandoga
ruslandoga force-pushed the crypto/dh-uint64-fix branch from 3a813ec to 37f5b5a Compare August 21, 2026 11:10
@Mikaka27

Copy link
Copy Markdown
Contributor

Well, there are conflicts on github unfortunately :(. In that case you can base it again on maint, and we will create more branches for older releases internally. Sorry about that :(

Signed-off-by: ruslandoga <ruslandoga+gh@icloud.com>
@ruslandoga
ruslandoga force-pushed the crypto/dh-uint64-fix branch from 37f5b5a to 74edf11 Compare August 21, 2026 11:29
@Mikaka27 Mikaka27 added the testing currently being tested, tag is used by OTP internal CI label Aug 21, 2026
@Mikaka27

Copy link
Copy Markdown
Contributor

I think we can avoid the copy (and additional variable on stack) by having a union with ErlNifUint64 and uint64_t instead, what do you think about this approach?

@Mikaka27 Mikaka27 added the waiting waiting for changes/input from author label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI waiting waiting for changes/input from author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants