Re: Is this not supposed to work in OpenSSL 3.0.x+?
Herbert <[email protected]>
| Newsgroups | gmane.comp.encryption.openssl.user |
|---|---|
| Message-ID | <[email protected]> |
On 11/05/2025 20:55, Karl Denninger wrote:
> [karl@NewFS ~/tmp]$ cat test.c
> #include <stdio.h>
> #include <string.h>
> #include <openssl/evp.h>
> #include <openssl/hmac.h>
>
> int main() {
> const char *key = "secretkey";
> const char *msg = "This is the message";
> unsigned char hmac_result[EVP_MAX_MD_SIZE];
> unsigned int hmac_len;
>
> HMAC(EVP_sha256(), key, strlen(key), (unsigned char*)msg,
> strlen(msg), hmac_result, &hmac_len);
>
> printf("HMAC-SHA256: ");
> for (int i = 0; i < hmac_len; i++) {
> printf("%02x", hmac_result[i]);
> }
> printf("\n");
>
> return 0;
> }
>
> [karl@NewFS ~/tmp]$ cc -o test test.c -lssl
The following seems to work:
$ cc -lcrypto -o test test.c
--
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/8f544e9a-bb6c-40de-a475-2860835f0aa5%40fastmail.jp.