Skip to content

Commit 4eb9a4d

Browse files
authored
Fix EVP_MD_CTX type definition for LibreSSL (#550)
From <openssl/evp.h> aka. EVP_Digest(3), otherwise OpenBSD builds fail: ``` /usr/include/openssl/ossl_typ.h:103:30: error: type alias redefinition with different types ('struct env_md_ctx_st' vs 'struct evp_md_ctx_st') typedef struct env_md_ctx_st EVP_MD_CTX; ^ /usr/ports/pobj/libdigidocpp-3.16.0/libdigidocpp-3.16.0/src/crypto/Digest.h:59:7: note: previous definition is here using EVP_MD_CTX = struct evp_md_ctx_st; ``` As metsma@ advised, don't include the OpenSSL header in this header to so as not to introduce build time dependencies to third party usages. Signed-off-by: Klemens Nanni <kn@openbsd.org>
1 parent c9d4ca7 commit 4eb9a4d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/crypto/Digest.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@
5656
#define URI_ECDSA_SHA384 "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"
5757
#define URI_ECDSA_SHA512 "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"
5858

59+
#ifdef LIBRESSL_VERSION_NUMBER
60+
using EVP_MD_CTX = struct env_md_ctx_st;
61+
#else
5962
using EVP_MD_CTX = struct evp_md_ctx_st;
63+
#endif
6064

6165
namespace digidoc
6266
{

0 commit comments

Comments
 (0)