2021-07-27 12:01:35 +00:00
|
|
|
|
NEW
|
|
|
|
|
PREFIX
|
|
|
|
|
AUTO 4,1
|
|
|
|
|
#!/BIN/SH
|
|
|
|
|
#
|
|
|
|
|
# This script tests the HMAC-MD5 command to make
|
|
|
|
|
# sure it is properly generating and returning
|
|
|
|
|
# correct MD5 values.
|
|
|
|
|
#
|
|
|
|
|
# This test uses the SET var = `command` directive,
|
|
|
|
|
# testing that facility as well.
|
|
|
|
|
#
|
|
|
|
|
SET TestPhrase = "Hello World"
|
|
|
|
|
SET TestKey = "Super Secret Key"
|
|
|
|
|
SET CorrectValue = "41E1F2EE77BA4551318745CE12A4A6A4"
|
|
|
|
|
ECHO "\f\n HMAC-MD5 Test"
|
|
|
|
|
ECHO "\n\nThis script tests the HMAC-MD5 command to make"
|
|
|
|
|
ECHO "sure it is properly generating and returning"
|
|
|
|
|
ECHO "correct HMAC-MD5 values.\n\n"
|
|
|
|
|
SET Result = `HMACMD5 -D "$TestPhrase" -K "$TestKey"`
|
|
|
|
|
IF [ $Result = $CorrectValue ]
|
|
|
|
|
ECHO "This Test Passed"
|
|
|
|
|
IF [ -N $Log ]
|
|
|
|
|
SET T = $T + 1
|
|
|
|
|
SET P = $P + 1
|
|
|
|
|
ECHO "HMACMD5 Test Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO "This Test Failed"
|
|
|
|
|
ECHO "The returned result was: $Result"
|
|
|
|
|
IF [ -N $Log ]
|
|
|
|
|
SET T = $T + 1
|
|
|
|
|
SET F = $F + 1
|
|
|
|
|
ECHO "HMACMD5 Test Failed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
FI
|
|
|
|
|
echo \n\n
|
|
|
|
|
MAN
|
|
|
|
|
TEXT /MAKE/USR/SHARE/TESTS/HMACMD5TEST
|