Home
last modified time | relevance | path

Searched hist:"0 a6f2bcaec59ba016a066c08245244ebaa2aac81" (Results 1 – 1 of 1) sorted by relevance

/optee_os/scripts/
H A Dpem_to_pub_c.py0a6f2bcaec59ba016a066c08245244ebaa2aac81 Tue Mar 26 10:29:44 UTC 2019 Markus S. Wamser <markus.wamser@mixed-mode.de> pem_to_pub_c.py: Add sanity check for public exponent of TA signing key

This change fixes a potential security vulnerability.

The public exponent of the TA signing key is stored by OP-TEE OS as an
unsigned 32-bit integer. While rarely seen in the wild, public exponents
that overflow this storage field exist. Although the C compiler usually
generates an overflow warning when such an exponent would be set, this
happens only once after the key was changed and is easily overlooked.
With this change the script throws an exception, notifying the user of the
unsuitable key.

Without the sanity check, such an unsuitable key would simply lead to
TA signature verification failures. However, if the public exponent e
is close to a multiple of 2^32, a small exponent attack to forge a
signature might be feasible.

Signed-off-by: Markus S. Wamser <markus.wamser@mixed-mode.de>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
[jf: add file name to commit subject]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>