Index: tests/ciphers.csv ================================================================== --- tests/ciphers.csv +++ tests/ciphers.csv @@ -77,10 +77,16 @@ Digest Chan,sha1,,,read_chan sha1 md_data.dat,,,3AEFE840CA492C387E903F15ED6019E7AD833B47,,, Digest Chan,sha256,,,read_chan sha256 md_data.dat,,,B7DFDDEB0314A74FF56A8AC1E3DC57DF09BB52A96DA50F6549EB62CA61A0A491,,, Digest Chan,md5 bin,,,string toupper [binary encode hex [read_chan md5 md_data.dat -bin]],,,CCB1BE2E11D8183E843FF73DA8C6D206,,, Digest Chan,md5 hex,,,read_chan md5 md_data.dat -hex,,,CCB1BE2E11D8183E843FF73DA8C6D206,,, ,,,,,,,,,, +command,# Test HMAC,,,,,,,,, +Digest HMAC,data,,,"tls::digest md5 -key ""Example key"" -data ""Example string for message digest tests.""",,,901DA6E6976A71650C77443C37FF9C7F,,, +Digest HMAC,file,,,"tls::digest md5 -key ""Example key"" -file md_data.dat",,,901DA6E6976A71650C77443C37FF9C7F,,, +Digest HMAC,channel,knownBug,,"read_chan md5 md_data.dat -key ""Example key""",,,901DA6E6976A71650C77443C37FF9C7F,,, +Digest HMAC,data bin,,,"string toupper [binary encode hex [tls::digest md5 -bin -key ""Example key"" -data ""Example string for message digest tests.""]]",,,901DA6E6976A71650C77443C37FF9C7F,,, +,,,,,,,,,, command,# Test list protocols,,,,,,,,, Protocols,All,,,lcompare $protocols [::tls::protocols],,,missing {ssl2 ssl3} unexpected {},,, ,,,,,,,,,, command,# Test show version,,,,,,,,, Version,All,,,::tls::version,,glob,*,,, Index: tests/ciphers.test ================================================================== --- tests/ciphers.test +++ tests/ciphers.test @@ -213,24 +213,42 @@ } -result {CCB1BE2E11D8183E843FF73DA8C6D206} test Digest_Chan-9.6 {md5 hex} -body { read_chan md5 md_data.dat -hex } -result {CCB1BE2E11D8183E843FF73DA8C6D206} +# Test HMAC + + +test Digest_HMAC-10.1 {data} -body { + tls::digest md5 -key "Example key" -data "Example string for message digest tests." + } -result {901DA6E6976A71650C77443C37FF9C7F} + +test Digest_HMAC-10.2 {file} -body { + tls::digest md5 -key "Example key" -file md_data.dat + } -result {901DA6E6976A71650C77443C37FF9C7F} + +test Digest_HMAC-10.3 {channel} -constraint {knownBug} -body { + read_chan md5 md_data.dat -key "Example key" + } -result {901DA6E6976A71650C77443C37FF9C7F} + +test Digest_HMAC-10.4 {data bin} -body { + string toupper [binary encode hex [tls::digest md5 -bin -key "Example key" -data "Example string for message digest tests."]] + } -result {901DA6E6976A71650C77443C37FF9C7F} # Test list protocols -test Protocols-10.1 {All} -body { +test Protocols-11.1 {All} -body { lcompare $protocols [::tls::protocols] } -result {missing {ssl2 ssl3} unexpected {}} # Test show version -test Version-11.1 {All} -body { +test Version-12.1 {All} -body { ::tls::version } -match {glob} -result {*} -test Version-11.2 {OpenSSL} -constraints {OpenSSL} -body { +test Version-12.2 {OpenSSL} -constraints {OpenSSL} -body { ::tls::version } -match {glob} -result {OpenSSL*} # Cleanup ::tcltest::cleanupTests