Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting ed25519 does not throw in browser #3

Open
emilbayes opened this issue Nov 7, 2016 · 6 comments
Open

Converting ed25519 does not throw in browser #3

emilbayes opened this issue Nov 7, 2016 · 6 comments

Comments

@emilbayes
Copy link

Consider the following snippet:

var sodium = require('chloride')

// crypto_sign_SEEDBYTES is missing too

var seed = Buffer.alloc(sodium.crypto_sign_SEEDBYTES || 32).fill('bug')

var keypair = sodium.crypto_sign_seed_keypair(seed)

var box_pk = sodium.crypto_sign_ed25519_pk_to_curve25519(keypair.secretKey)

console.log(box_pk)

In node the above throws an error due to the input being too long (here the secretKey is mistakenly used) but in the browser it happily continues. I'm not sure where to report this? Should I ensure the input myself instead?

@emilbayes
Copy link
Author

Oh yeah, here are the commands I used to test, just for reference

Node:

node bug.js

Browser:

browserify bug.js | browser-run

@dominictarr
Copy link
Contributor

okay, what we should do, is extend https://github.com/dominictarr/chloride-test to also test for throws with invalid inputs. then make sure that everything does.

@emilbayes
Copy link
Author

Do you want me to look into that? There are some other compatibility issues between the browser versions and node-sodium that I'm unsure about. Is there a better place to ask questions than here?

@dominictarr
Copy link
Contributor

well, you'll get me either way, but that is where we should lock down the behavior. if they are not exactly the same then that is a bug!

@emilbayes
Copy link
Author

Hehe, I was thinking another venue than Github. IRC? I'm active on #stackvm and #scuttlebutt

@dominictarr
Copy link
Contributor

ah, well I don't really keep regular hours so async (github, ssb) works best for me

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

No branches or pull requests

2 participants