That's a hex number, so you have to use 16 as the final arg to your strtol() function. However, I'd guess that this number will never fit into even an unsigned long long (using strtoull), and a test confirms:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int main(int argc, const char *argv[]) {
char key[]="016211c7f60824a8ec5df54737a08ad0a11b2e451160601a94ccd53555a335";
unsigned long long x = strtoull(key, NULL, 16);
if (x == ULLONG_MAX) puts("nope!");
return 0;
}
nope!
So you've got something wrong. I can't find a reference to an AES_key_wrap(), but if you mean AES_wrap_key(), methinks you have misunderstood the arguments:
Code:
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
unsigned char *out,
const unsigned char *in, unsigned int inlen);