]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - test/vboot/vboot_test.sh
Implement generalised RSA public exponents for verified boot
[karo-tx-uboot.git] / test / vboot / vboot_test.sh
index 8074fc6adc0708c984297c2172ad41ded4f0995e..6d7abb82bd72b85a861e3524a7b92c34e853817a 100755 (executable)
@@ -54,8 +54,16 @@ echo ${mkimage} -D "${dtc}"
 echo "Build keys"
 mkdir -p ${keys}
 
+PUBLIC_EXPONENT=${1}
+
+if [ -z "${PUBLIC_EXPONENT}" ]; then
+       PUBLIC_EXPONENT=65537
+fi
+
 # Create an RSA key pair
-openssl genrsa -F4 -out ${keys}/dev.key 2048 2>/dev/null
+openssl genpkey -algorithm RSA -out ${keys}/dev.key \
+    -pkeyopt rsa_keygen_bits:2048 \
+    -pkeyopt rsa_keygen_pubexp:${PUBLIC_EXPONENT} 2>/dev/null
 
 # Create a certificate containing the public key
 openssl req -batch -new -x509 -key ${keys}/dev.key -out ${keys}/dev.crt