-
Notifications
You must be signed in to change notification settings - Fork 14
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
Crypto: sancus_unwrap
always fails if cipher_len
is zero
#26
Comments
That's interesting..do we have a |
I just added a test on my repo: gianlu33/sancus-examples@19c68f9 You can adjust the value of You can also experience the bug mentioned in #1 if you specify an odd number for Edit: oops, I messed up with the TAG length.. I updated the commit |
hm it seems like you want the inverse of In principle one could fix the hardware to support this, but not sure this is worth it. You essentially can call |
there's sensor-reader for that, with a full round-trip: wrap of a random number in the sancus enclave and an unwrap later in the makefile to simulate the remote stakeholder |
linking this to #27 |
Ideally, what we would like to happen is a simple comparison between the provided MAC (
tag
) and the MAC calculated over the provided associated data (ad
). This is not happening though, the return value ofsancus_unwrap
is alwaysfalse
.Interestingly,
sancus_wrap
works fine if the plaintext length is zero. In fact, it returnstrue
and the calculated MAC is correct.Note that the result if the same no matter the value of the
cipher
pointer (NULL or not): ifcipher_len
is zero,sancus_unwrap
always fails.The text was updated successfully, but these errors were encountered: