*match_other = ID_MATCH_PERFECT;
}
shared = shared_key_create(type, chunk_clone(chunk_from_str(pwd)));
+ memwipe(pwd, strlen(pwd));
/* cache password in case it is required more than once */
this->creds->add_shared(this->creds, shared, NULL);
return shared->get_ref(shared);
*match_other = ID_MATCH_NONE;
}
shared = shared_key_create(type, chunk_clone(chunk_from_str(secret)));
+ memwipe(secret, strlen(secret));
/* cache password in case it is required more than once */
cb_creds->add_shared(cb_creds, shared, NULL);
return shared->get_ref(shared);
if (pass)
{
stream->write_all(stream, pass, strlen(pass));
+ memwipe(pass, strlen(pass));
stream->write_all(stream, "\n", 1);
}
}
*match_other = ID_MATCH_PERFECT;
}
shared = shared_key_create(type, chunk_clone(chunk_from_str(pwd)));
+ memwipe(pwd, strlen(pwd));
/* cache secret if it is required more than once (PKCS#12) */
data->cache->add_shared(data->cache, shared, NULL);
return shared->get_ref(shared);
{
#ifdef HAVE_GETPASS
snprintf(prompt, sizeof(prompt), "PIN for %s: ", section);
- pin = strdupnull(getpass(prompt));
+ pin = getpass(prompt);
#endif
}
load_token(ctx, section, pin);
if (pin)
{
memwipe(pin, strlen(pin));
- free(pin);
pin = NULL;
}
}