summaryrefslogtreecommitdiff
path: root/src/shared/gcrypt-util.h
diff options
context:
space:
mode:
authorStefan Schweter <stefan@schweter.it>2016-10-08 13:59:34 +0200
committerLennart Poettering <lennart@poettering.net>2016-10-08 13:59:34 +0200
commita60f4d0b4403ae398594f9426832e7a4ed9ca686 (patch)
tree96aac45791fdcef52526bec517677e7c1988a493 /src/shared/gcrypt-util.h
parente63be0847c39bfdca45c25c505922814374581a7 (diff)
systemd-resolve: use sha256 for local-part of openpgp key (#4193)
Diffstat (limited to 'src/shared/gcrypt-util.h')
-rw-r--r--src/shared/gcrypt-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/gcrypt-util.h b/src/shared/gcrypt-util.h
index cf33b3c59c..1da12a32be 100644
--- a/src/shared/gcrypt-util.h
+++ b/src/shared/gcrypt-util.h
@@ -37,3 +37,11 @@ static inline int string_hashsum_sha224(const char *s, size_t len, char **out) {
return -EOPNOTSUPP;
#endif
}
+
+static inline int string_hashsum_sha256(const char *s, size_t len, char **out) {
+#ifdef HAVE_GCRYPT
+ return string_hashsum(s, len, GCRY_MD_SHA256, out);
+#else
+ return -EOPNOTSUPP;
+#endif
+}