Re: Is this not supposed to work in OpenSSL 3.0.x+?

Karl Denninger <[email protected]>
Newsgroups gmane.comp.encryption.openssl.user
Message-ID <[email protected]>
On 5/11/2025 17:55, Herbert wrote:
>
>
> 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
>
Ah so its not in the -lssl library, its in -lcrypto.  Thank you.

-- 
Karl Denninger
[email protected]
/The Market Ticker/
/[S/MIME encrypted email preferred]/

-- 
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/cb26a344-4c30-4bbe-a6a9-1b5ac87b9114%40denninger.net.
smime.p7s (application/pkcs7-signature, 4.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.