mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2026-02-04 13:21:34 +00:00
Merge 70cccaf58c into 587a5f9400
This commit is contained in:
commit
591df743ac
1 changed files with 5 additions and 0 deletions
5
gnupg.c
5
gnupg.c
|
|
@ -1048,6 +1048,7 @@ PHP_FUNCTION(gnupg_adddecryptkey)
|
|||
phpc_str_size_t passphrase_len;
|
||||
gpgme_key_t gpgme_key;
|
||||
gpgme_subkey_t gpgme_subkey;
|
||||
int loopback_set = 0;
|
||||
|
||||
GNUPG_GETOBJ();
|
||||
|
||||
|
|
@ -1073,6 +1074,10 @@ PHP_FUNCTION(gnupg_adddecryptkey)
|
|||
PHPC_HASH_CSTR_ADD_PTR(
|
||||
PHPC_THIS->decryptkeys, gpgme_subkey->keyid,
|
||||
passphrase, passphrase_len + 1);
|
||||
if (!loopback_set && passphrase && passphrase_len > 0) {
|
||||
gpgme_set_pinentry_mode(PHPC_THIS->ctx, GPGME_PINENTRY_MODE_LOOPBACK);
|
||||
loopback_set = 1;
|
||||
}
|
||||
}
|
||||
gpgme_subkey = gpgme_subkey->next;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue