summaryrefslogtreecommitdiffstats
path: root/debian/tests/sha2-contrib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:54:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:54:14 +0000
commit83da7a0ac93decce70c1a02b0739020d8e2b69fd (patch)
tree0c298e82da8861a97aa152863f30eb4af5b80b37 /debian/tests/sha2-contrib
parentAdding upstream version 2.6.7+dfsg. (diff)
downloadopenldap-83da7a0ac93decce70c1a02b0739020d8e2b69fd.tar.xz
openldap-83da7a0ac93decce70c1a02b0739020d8e2b69fd.zip
Adding debian version 2.6.7+dfsg-1~exp1.debian/2.6.7+dfsg-1_exp1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/sha2-contrib')
-rwxr-xr-xdebian/tests/sha2-contrib16
1 files changed, 16 insertions, 0 deletions
diff --git a/debian/tests/sha2-contrib b/debian/tests/sha2-contrib
new file mode 100755
index 0000000..32f7637
--- /dev/null
+++ b/debian/tests/sha2-contrib
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -e
+
+reference_hash="{SHA256}$(echo -n secret | openssl dgst -sha256 -binary | openssl enc -base64)"
+test_hash=$(/usr/sbin/slappasswd -s secret -h '{SHA256}' -o module-load=pw-sha2)
+
+echo "Reference hash of \"secret\" (openssl): ${reference_hash}"
+echo "slapd's pw-sha2 hash: ${test_hash}"
+
+if [ "${reference_hash}" != "${test_hash}" ]; then
+ echo "ERROR: hashes differ"
+ exit 1
+else
+ echo "PASS: hashes are identical"
+fi