using secure memory where applicable using sodium_malloc or sodium_mlock, where not

This commit is contained in:
TLINDEN
2015-01-13 13:07:32 +01:00
parent ecf243b7ae
commit 3c30d8871b
14 changed files with 92 additions and 50 deletions

View File

@@ -62,12 +62,12 @@ int pcpsign(char *infile, char *outfile, char *passwd, int z85, int detach) {
"Enter passphrase to decrypt your secret key", NULL, 1);
}
else {
passphrase = ucmalloc(strlen(passwd)+1);
strncpy(passphrase, passwd, strlen(passwd)+1);
passphrase = smalloc(strlen(passwd)+1);
memcpy(passphrase, passwd, strlen(passwd)+1);
}
secret = pcpkey_decrypt(ptx, secret, passphrase);
ucfree(passphrase, strlen(passwd)+1);
sfree(passphrase);
if(secret == NULL)
goto errs1;
}