-/* $OpenBSD: sk-usbhid.c,v 1.30 2021/05/31 06:48:42 djm Exp $ */
+/* $OpenBSD: sk-usbhid.c,v 1.31 2021/10/01 04:50:36 djm Exp $ */
/*
* Copyright (c) 2019 Markus Friedl
* Copyright (c) 2020 Pedro Martelletto
{
#ifdef WITH_OPENSSL
u_int mdlen;
+#else
+ SHA2_CTX ctx;
#endif
if (dlen != 32)
if (!EVP_Digest(m, mlen, d, &mdlen, EVP_sha256(), NULL))
return -1;
#else
- SHA256Data(m, mlen, d);
+ SHA256Init(&ctx);
+ SHA256Update(&ctx, (const uint8_t *)m, mlen);
+ SHA256Final(d, &ctx);
#endif
return 0;
}