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

curve255.19.c:91:12: runtime error: left shift of negative value -329 #312

Open
sbytnar opened this issue Jun 19, 2024 · 1 comment
Open
Labels

Comments

@sbytnar
Copy link

sbytnar commented Jun 19, 2024

To reproduce this, build curve25519.c with -fsanitize=undefined.
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)

Run the dropbear server from the command line.
Connect to the dropbear server.
The message is printed on the console.

@mkj mkj added the bug label Jun 19, 2024
@mkj
Copy link
Owner

mkj commented Jun 19, 2024

Putting if (c < 0) printf at line 91 I can reproduce it, though I couldn't get ubsan to catch it. It certainly looks like undefined behaviour, I'll figure how to fix that.

The curve25519 implementation is from tweetnacl, I'm surprised the problem hasn't been reported elsewhere (that I can find).

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

No branches or pull requests

2 participants