Don't let the compiler optimize the code, i.e.: this untested code
Or the way libsodium does it
It's similar but they seem to use a uchar volatile *volatile… I've never made a pointer volatile on purpose, so I don't know what that does.
Right… So I looked into it and I can't find any place where it's actually used. So it might be a good idea to just either get rid of it or add a [[depricated]] attribute
https://github.com/Fedict/eid-mw/blob/2b8d9b1ee211d49011838d662cf899fe4dc3b9ba/cardcomm/pkcs11/src/pkcs11util.cpp#L53-L59
Expected Behavior:
Set
len
bytes to 0, starting atp_in
.Actual Behavior:
AS-IF setting the bytes to 0.
Proposed Fix:
Don't let the compiler optimize the code, i.e.: this untested code Or the way libsodium does it It's similar but they seem to use a
uchar volatile *volatile
… I've never made a pointer volatile on purpose, so I don't know what that does.