Bug 3467 - [upstream] arc4random: make rekey interval less predictable
Summary: [upstream] arc4random: make rekey interval less predictable
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: Other All
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_9_1
  Show dependency treegraph
 
Reported: 2022-08-03 21:41 AEST by Loganaden Velvindron
Modified: 2022-10-04 21:58 AEDT (History)
2 users (show)

See Also:


Attachments
Make rekey interval less predictable. (1.34 KB, patch)
2022-08-03 21:41 AEST, Loganaden Velvindron
no flags Details | Diff
Make rekey interval less predictable. (1.60 KB, patch)
2022-08-03 22:33 AEST, Loganaden Velvindron
no flags Details | Diff
Factor out getrnd() into its own file and rename to getentropy() (5.48 KB, patch)
2022-08-04 21:45 AEST, Darren Tucker
djm: ok+
Details | Diff
Split arc4random_uniform out into its own file. (4.52 KB, patch)
2022-08-05 13:48 AEST, Darren Tucker
djm: ok+
Details | Diff
Resync arc4random with OpenBSD rev 1.58 (10.57 KB, patch)
2022-08-05 14:54 AEST, Darren Tucker
djm: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Loganaden Velvindron 2022-08-03 21:41:33 AEST
Created attachment 3605 [details]
Make rekey interval less predictable.

This patch sync's OpenSSH compat arc4random with the one in OpenBSD.
Comment 1 Loganaden Velvindron 2022-08-03 22:33:51 AEST
Created attachment 3606 [details]
Make rekey interval less predictable.
Comment 2 Darren Tucker 2022-08-04 21:38:09 AEST
We should probably resync all of the changes from OpenBSD, but it'll need to be done carefully.
Comment 3 Darren Tucker 2022-08-04 21:45:16 AEST
Created attachment 3607 [details]
Factor out getrnd() into its own file and rename to getentropy()

Step 1: factor out getentropy equivalent code into its own file.
Comment 4 Darren Tucker 2022-08-05 13:48:59 AEST
Created attachment 3608 [details]
Split arc4random_uniform out into its own file.

This matches the file currently in OpenBSD.  It also changes the types from u_int32_t to uint32_t which happened in OpenBSD's arc4random.c rev 1.40.
Comment 5 Darren Tucker 2022-08-05 14:54:16 AEST
Created attachment 3609 [details]
Resync arc4random with OpenBSD rev 1.58

Step 3: resync remaining changes.  The arc4random.h is taken from LibreSSL with some simplifications (most of the platform specific code is the same with the exception of  thread support, however we don't support that.)

(Also marking patch 3607 as obsolete as it's gone in.)
Comment 6 Damien Miller 2022-08-06 16:18:45 AEST
Comment on attachment 3609 [details]
Resync arc4random with OpenBSD rev 1.58

>--- a/openbsd-compat/arc4random.c
>+++ b/openbsd-compat/arc4random.c
...
> /*
>  * If we are providing arc4random, then we can provide a more efficient 

whitespace at EOL here
Comment 7 Darren Tucker 2022-09-02 14:33:12 AEST
The full resync of arc4random went is as https://github.com/openssh/openssh-portable/commit/ce39e7d8b70c4726defde5d3bc4cb7d40d131153

This greatly reduces the diff of portable vs openbsd.
Comment 8 Damien Miller 2022-10-04 21:58:54 AEDT
Closing bugs from openssh-9.1 release cycle