-
Notifications
You must be signed in to change notification settings - Fork 101
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
Unaligned access in random_bytes() and rand_get_bytes() #195
Comments
Part of the issue is the SPDM specification itself, and how fields are laid out within a request or response. There's also endianness issues as well. In the short term we can fix this; in the long term need a strategy on whether to accommodate all alignment issues. |
Will defer to STABLE 0.2. |
@rw8896, do you want to propose a fix? |
As @steven-bellock commented, the short term solution is just to avoid the uint64 assignment in these two rand.c files. I am not sure about the long term strategy to address the alignment and endianness issues though. |
libspdm/os_stub/cryptlib_mbedtls/rand/rand.c
Line 63 in 631028a
libspdm/os_stub/openssllib/rand_pool.c
Line 48 in 631028a
These assignments may cause unaligned access when output or RandBuffer is not at alignment of uint64_t.
Better to use copy_mem() instead.
The text was updated successfully, but these errors were encountered: