[01/15] t/oid-info: allow looking up hash algorithm name
diff mbox series

Message ID 20191005211209.18237-2-sandals@crustytoothpaste.net
State New
Headers show
Series
  • SHA-256 test fixes, part 6
Related show

Commit Message

brian m. carlson Oct. 5, 2019, 9:11 p.m. UTC
The test_oid function provides a mechanism for looking up hash algorithm
information, but it doesn't specify a way to discover the hash algorithm
name.  Knowing this information is useful if one wants to invoke the
test-tool helper for the algorithm in use, such as in our pack
generation library.

While it's currently possible to inspect the global variable holding
this value, in the future we'll allow specifying an algorithm for
storage and an algorithm for display, so it's better to abstract this
value away.  To assist with this, provide a named entry in the
algorithm-specific lookup table that prints the algorithm in use.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 t/oid-info/hash-info | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/t/oid-info/hash-info b/t/oid-info/hash-info
index ccdbfdf974..6b5ded0b34 100644
--- a/t/oid-info/hash-info
+++ b/t/oid-info/hash-info
@@ -6,3 +6,6 @@  hexsz sha256:64
 
 zero sha1:0000000000000000000000000000000000000000
 zero sha256:0000000000000000000000000000000000000000000000000000000000000000
+
+algo sha1:sha1
+algo sha256:sha256