Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Extract Sodium::Buffer into a separate gem? #19

Open
tarcieri opened this issue Sep 14, 2013 · 12 comments
Open

Extract Sodium::Buffer into a separate gem? #19

tarcieri opened this issue Sep 14, 2013 · 12 comments
Assignees

Comments

@tarcieri
Copy link

Sodium::Buffer is generally useful anywhere we have buffers that contain secrets we don't want to get swapped. I just had a coworker the other day asking about how to do that sort of thing ;)

It would be really great if it could be extracted into a separate gem. Maybe we could get @luislavena to help figure out the Windows story, considering it presently depends on FFI::Library::LIBC

@luislavena
Copy link

@tarcieri can you point me to which functions it depends from libc?

@tarcieri
Copy link
Author

@luislavena it uses the mlock function, which indicates to the OS that the given region of memory should not be swapped out:

https://www.gnu.org/software/libc/manual/html_node/Page-Lock-Functions.html

The use case here is because it contains cryptographic keys or plaintexts that we'd like to keep confidential.

It looks like the Windows equivalent is VirtualLock:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa366895(v=vs.85).aspx

@ghost ghost assigned stouset Sep 17, 2013
@stouset
Copy link
Owner

stouset commented Sep 17, 2013

I'm open to this. It totally didn't cross my mind that Windows doesn't have mlock.

Any suggestions for a name?

@tarcieri
Copy link
Author

Well, "mlock" is available if you don't mind being boring ;)

@stouset
Copy link
Owner

stouset commented Sep 17, 2013

BUT IT'S SO MUCH MORE.

@stouset
Copy link
Owner

stouset commented Sep 17, 2013

What name did I throw out at beers ephemeral? What about transient?

@stouset
Copy link
Owner

stouset commented Sep 17, 2013

Both names taken. Gem names are the new DNS.

@stouset
Copy link
Owner

stouset commented Sep 17, 2013

string-ephemeral and String::Ephemeral seems not unreasonable to me.

@tarcieri
Copy link
Author

How about "poof"? ;)

@stouset
Copy link
Owner

stouset commented Oct 1, 2013

I haven't done this yet, have I?

I'll do this.

@tarcieri
Copy link
Author

tarcieri commented Oct 1, 2013

you haven't done it to my knowledge ;)

@tarcieri
Copy link
Author

tarcieri commented Oct 1, 2013

securebuffer is another boring name ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants