X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fdigest.h;h=dba6ee4402ca60bec351c4b7abedc387d433833d;hb=01dc7836703ba3aa113f3d0102f13ba73319e50b;hp=1cebf582b5b573ec83b2e4c749f7936703f5d53d;hpb=2c6b2d70e6640f39563ad7bb0aa0ba87f883848c;p=tinc diff --git a/src/digest.h b/src/digest.h index 1cebf582..dba6ee44 100644 --- a/src/digest.h +++ b/src/digest.h @@ -3,7 +3,7 @@ /* digest.h -- header file digest.c - Copyright (C) 2007-2016 Guus Sliepen + Copyright (C) 2007-2022 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,10 +27,20 @@ #ifndef DISABLE_LEGACY +#ifdef HAVE_OPENSSL +#include "openssl/digest.h" +#elif HAVE_LIBGCRYPT +#include "gcrypt/digest.h" +#else +#error Incorrect cryptographic library, please reconfigure. +#endif + typedef struct digest digest_t; -extern digest_t *digest_open_by_name(const char *name, size_t maclength) __attribute__((__malloc__)); -extern digest_t *digest_open_by_nid(int nid, size_t maclength) __attribute__((__malloc__)); +extern bool digest_open_by_name(digest_t *digest, const char *name, size_t maclength); +extern bool digest_open_by_nid(digest_t *digest, int nid, size_t maclength); +extern digest_t *digest_alloc(void) __attribute__((__malloc__)); +extern void digest_free(digest_t **digest); extern void digest_close(digest_t *digest); extern bool digest_create(digest_t *digest, const void *indata, size_t inlen, void *outdata) __attribute__((__warn_unused_result__)); extern bool digest_verify(digest_t *digest, const void *indata, size_t inlen, const void *digestdata) __attribute__((__warn_unused_result__));