mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 01:18:06 +00:00
Fix test case with newer openssl.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
ae61150f5c
commit
de33124d6b
1 changed files with 3 additions and 3 deletions
|
|
@ -7,9 +7,9 @@ test $? -eq 0 || exit $?
|
||||||
rsa_encrypt_decrypt() {
|
rsa_encrypt_decrypt() {
|
||||||
openssl pkeyutl -encrypt -pubin -inkey 1.pub $2 -in $1 -out data.crypt
|
openssl pkeyutl -encrypt -pubin -inkey 1.pub $2 -in $1 -out data.crypt
|
||||||
test $? -eq 0 && echo -n "." || exit $?
|
test $? -eq 0 && echo -n "." || exit $?
|
||||||
TDATA=$(tr -d '\0' < <(pkcs11-tool --id 1 --pin 648219 --decrypt $3 -i data.crypt 2>/dev/null))
|
TDATA=$(pkcs11-tool --id 1 --pin 648219 --decrypt $3 -i data.crypt 2>/dev/null | sed '/^OAEP parameters:/d' | tr -d '\0')
|
||||||
test $? -eq 0 && echo -n "." || exit $?
|
test $? -eq 0 && echo -n "." || exit $?
|
||||||
if [[ ${TEST_STRING} != "$TDATA" ]]; then
|
if [[ "$TEST_STRING" != "$TDATA" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
test $? -eq 0 && echo -n "." || exit $?
|
test $? -eq 0 && echo -n "." || exit $?
|
||||||
|
|
@ -36,7 +36,7 @@ rsa_encrypt_decrypt data_pad "-pkeyopt rsa_padding_mode:none" "--mechanism RSA-X
|
||||||
test $? -eq 0 && echo -e ".\t${OK}" || exit $?
|
test $? -eq 0 && echo -e ".\t${OK}" || exit $?
|
||||||
|
|
||||||
echo -n " Test RSA-PKCS-OAEP ciphering..."
|
echo -n " Test RSA-PKCS-OAEP ciphering..."
|
||||||
rsa_encrypt_decrypt data "-pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 -pkeyopt rsa_mgf1_md:sha256" "--mechanism RSA-PKCS-OAEP"
|
rsa_encrypt_decrypt data "-pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 -pkeyopt rsa_mgf1_md:sha256" "--mechanism RSA-PKCS-OAEP --hash-algorithm SHA256 --mgf MGF1-SHA256"
|
||||||
test $? -eq 0 && echo -e ".\t${OK}" || exit $?
|
test $? -eq 0 && echo -e ".\t${OK}" || exit $?
|
||||||
|
|
||||||
rm -rf data* 1.*
|
rm -rf data* 1.*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue