On 11/15/2011 11:39 AM, Henrik Grindal Bakken wrote:
Jonas Schnelli
<jonas.schne...@include7.ch> writes:
#include<openssl-1.0.0e/include/openssl/hmac.h>
#include<openssl-1.0.0e/include/openssl/evp.h>
#include<string.h>
char key[20] = { 0 };
int
main()
{
HMAC_CTX * context;
context = (HMAC_CTX *) malloc(sizeof(*context));
Do you need to malloc the context (a pointer) ?
I don't think so.
Remove the line?
That won't work, but you can do
HMAC_CTX context;
and use&context instead of context.
Why would that be any different?
When OpenSSL gets a HMAC_CTX*, it shouldn't care if it points to
memory on the stack or the heap, as long as that memory is
sizeof(HMAC_CTX) big and maybe appropriately initialized.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org