Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PEP 522: BlockingIOError in security sensitive APIs on Linux#13

Merged
ncoghlan merged 2 commits into
python:masterpython/peps:masterfrom
ncoghlan:security-sensitive-rngncoghlan/peps:security-sensitive-rngCopy head branch name to clipboard
Jun 16, 2016
Merged

PEP 522: BlockingIOError in security sensitive APIs on Linux#13
ncoghlan merged 2 commits into
python:masterpython/peps:masterfrom
ncoghlan:security-sensitive-rngncoghlan/peps:security-sensitive-rngCopy head branch name to clipboard

Conversation

@ncoghlan

Copy link
Copy Markdown
Contributor

No description provided.

@ncoghlan

Copy link
Copy Markdown
Contributor Author

@dstufft @njsmith Any comments before I check in this initial draft?

Comment thread pep-0522.txt Outdated

No changes are proposed for Windows or Mac OS X systems, as neither of those
platforms provides any mechanism to run Python code before the operating
system random number generator has been initialised.

@dstufft dstufft Jun 16, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be reasonable to mention somewhere that OS X finds a secure sense source of random so important, that it will kernel panic rather than continue to boot if it can't get enough random during it's boot process.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E_NOTENOUGHENTROPY? Wouldn't want the heat death of the universe to break the build ...

Sent from my iPhone

On 16 Jun 2016, at 21:14, Donald Stufft notifications@github.com wrote:

In pep-0522.txt:

+In all cases, as soon as a call to os.urandom() succeeds, all future
+calls to os.urandom() in that process will succeed (once the operating
+system random number generator is ready after system boot, it remains ready).
+
+
+Proposal
+========
+
+This PEP proposes that in Python 3.6+, os.urandom() be updated to call
+the new Linux `getrandom()syscall in non-blocking mode if available and +raiseBlockingIOError: system random number generator is not ready`` if
+the kernel reports that the call would block.
+
+No changes are proposed for Windows or Mac OS X systems, as neither of those
+platforms provides any mechanism to run Python code before the operating
+system random number generator has been initialised.
It might be reasonable to mention somewhere that OS X finds a secure sense of random so important, that it will kernel panic rather than continue to boot if it can't get enough random during it's boot process.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@dstufft

dstufft commented Jun 16, 2016

Copy link
Copy Markdown
Member

A few small nits, but 👍

- Note MAC OS X kernel panic behaviour
- Fix copy & paste error in example function name
- Note getrandom() doesn't offer /dev/urandom behaviour
@ncoghlan ncoghlan merged commit 69c7677 into python:master Jun 16, 2016
@ncoghlan

Copy link
Copy Markdown
Contributor Author

I merged this to explicitly reserve the PEP number. I'll still give @njsmith a chance to comment before posting to python-dev about it.

@njsmith

njsmith commented Jun 17, 2016

Copy link
Copy Markdown
Contributor

I read it, and thought "hmm, I think this could flow better to make a more compelling argument", and then I started poking at the text and uh. Is a PR tomorrow good? :-)

@ncoghlan

Copy link
Copy Markdown
Contributor Author

@njsmith I also didn't find a good place to explicitly state the assumption that random module initialisation and SipHash initialisation will be decoupled from reliance on the behaviour of os.urandom() (However, they could be incorporated into the PEP by saying that they will try os.urandom, and only use their fallbacks if that raises BlockingIOError)

@ncoghlan

Copy link
Copy Markdown
Contributor Author

@njsmith Just a heads up that I'm going to be working on major rewrite today - with an extra couple of days to ponder the topic, I have a different overall framing that I think will better sell the idea (although the core proposal remains the same)

@njsmith

njsmith commented Jun 19, 2016

Copy link
Copy Markdown
Contributor

Ah ok I'll at least throw what I've got up in a branch

@njsmith

njsmith commented Jun 19, 2016

Copy link
Copy Markdown
Contributor

#19

lukpueh pushed a commit to lukpueh/peps that referenced this pull request Oct 11, 2019
lukpueh pushed a commit to lukpueh/peps that referenced this pull request Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.