mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
added a request prompt if the user didn't enter a passphrase
This commit is contained in:
@@ -90,8 +90,16 @@ void pcp_keygen(char *passwd) {
|
|||||||
|
|
||||||
if(strnlen(passphrase, 1024) > 0)
|
if(strnlen(passphrase, 1024) > 0)
|
||||||
key = pcpkey_encrypt(k, passphrase);
|
key = pcpkey_encrypt(k, passphrase);
|
||||||
else
|
else {
|
||||||
key = k;
|
char *yes = pcp_getstdin("WARNING: secret key will be stored unencrypted. Are you sure [yes|NO]?");
|
||||||
|
if(strncmp(yes, "yes", 1024) == 0)
|
||||||
|
key = k;
|
||||||
|
else {
|
||||||
|
memset(key, 0, sizeof(pcp_key_t));
|
||||||
|
free(key);
|
||||||
|
goto errkg1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(key != NULL) {
|
if(key != NULL) {
|
||||||
if(pcp_storekey(key) == 0) {
|
if(pcp_storekey(key) == 0) {
|
||||||
@@ -99,6 +107,8 @@ void pcp_keygen(char *passwd) {
|
|||||||
pcpkey_printshortinfo(key);
|
pcpkey_printshortinfo(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
errkg1:
|
||||||
free(mail);
|
free(mail);
|
||||||
free(owner);
|
free(owner);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user