Skip to content

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

Merged
Mikaka27 merged 2 commits into
erlang:maintfrom
ruslandoga:crypto/dh-uint64-fix
Aug 26, 2026
Merged

Mikaka27 merged 2 commits 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   6m 3s ⏱ïļ
195 tests 177 ✅  18 ðŸ’Ī 0 ❌
497 runs  346 ✅ 151 ðŸ’Ī 0 ❌

Results for commit 864b207.

â™ŧïļ 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
@Mikaka27 Mikaka27 removed waiting waiting for changes/input from author testing currently being tested, tag is used by OTP internal CI labels Aug 25, 2026
@Mikaka27
Mikaka27 requested a review from sverker August 25, 2026 08:22
@Mikaka27
Mikaka27 merged commit d31f1cc into erlang:maint Aug 26, 2026
34 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crypto: dh.c fails to compile on macOS arm64 due to ErlNifUInt64/uint64_t pointer mismatch

3 participants