mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-07-02 13:43:16 +02:00
ima_evm_utils: Add testing with elliptic curves prime192v1 and 256v1
Add test cases that test the signing and signature verification with the elliptic curves prime192v1 and prime256v1, also known as NIST P192 and P256. These curves will soon be supported by Linux. If OpenSSL cannot generate prime192v1 keys, as is the case on Fedora, where this curve is not supported, the respective tests will be skipped automatically. The r and s integer components of the signature can have varying size. Therefore we do the size checks for the entire signature with a regular expression that accounts for the varying size. The most typical cases are supported following hours of running the tests with varying keys. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:

committed by
Mimi Zohar

parent
cbbe31e1ca
commit
9473e3c887
@ -66,6 +66,26 @@ for m in 1024 2048; do
|
||||
fi
|
||||
done
|
||||
|
||||
for curve in prime192v1 prime256v1; do
|
||||
if [ "$1" = clean ] || [ "$1" = force ]; then
|
||||
rm -f test-$curve.cer test-$curve.key test-$curve.pub
|
||||
fi
|
||||
if [ "$1" = clean ]; then
|
||||
continue
|
||||
fi
|
||||
if [ ! -e test-$curve.key ]; then
|
||||
log openssl req -verbose -new -nodes -utf8 -sha1 -days 10000 -batch -x509 \
|
||||
-config test-ca.conf \
|
||||
-newkey ec \
|
||||
-pkeyopt ec_paramgen_curve:$curve \
|
||||
-out test-$curve.cer -outform DER \
|
||||
-keyout test-$curve.key
|
||||
if [ -s test-$curve.key ]; then
|
||||
log openssl pkey -in test-$curve.key -out test-$curve.pub -pubout
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# EC-RDSA
|
||||
for m in \
|
||||
gost2012_256:A \
|
||||
|
Reference in New Issue
Block a user