- free_key(p->key);
- p->key = xmalloc(sizeof(*p->key));
- p->key->length = strlen(ek);
- p->key->expiry = p->public_key->expiry;
- p->key->key = xmalloc(strlen(ek) + 1);
- strcpy(p->key->key, ek);
+ free_key(p->datakey);
+ p->datakey = xmalloc(sizeof(*p->datakey));
+ p->datakey->length = strlen(ek);
+ p->datakey->expiry = p->public_key->expiry;
+ p->datakey->key = xmalloc(strlen(ek) + 1);
+ strcpy(p->datakey->key, ek);