-
-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
added aes-gcm #2165
base: master
Are you sure you want to change the base?
added aes-gcm #2165
Conversation
yea there still need work to be done |
Thanks! So where are we at with this? Does it build and work ok for those test scripts? |
the problem im running into is, the encrypted data being generated from mbedtls is not verifyable (it can decrypt it, but the gcm tag is invalid causing a failed decryption ).. but encrypted data from webcrypt/browser is verifyable in mbed tls |
SIDE note, so instead of hunting down the issue on that yesterday.. i coded up ECDH https://gist.github.com/bmatusiak/a1ac4b31cf5fd4c2c4ac2a9b0fd377ff |
ok i fixed gcm encrypt auth tag |
I changed IV to be a variable length, 16 = {0} is default(for all modes) added
|
jsvIterateCallbackToBytes(ivVar, iv, sizeof(iv)); | ||
if (ivVar && !jsvIsUndefined(ivVar)) { | ||
iv_size = (size_t)jsvGetLength(ivVar); | ||
jsvIterateCallbackToBytes(ivVar, &iv_bytes, (unsigned int)iv_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it's taken so long to look into this - but this one in particular looks broken.
iv_bytes is never set, so at this point jsvIterateCallbackToBytes will write into a random area of memory! It's possible that by using &iv_bytes you're just writing onto the stack, but there's definitely an issue here...
this need testing,
but here in a test scripts for espruino and browser
https://gist.github.com/bmatusiak/c4517056a93f96ea904e85b7f5c0ddb5