This commit is contained in:
TerraTech 2018-06-03 23:07:10 +00:00 committed by GitHub
commit 591df743ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1048,6 +1048,7 @@ PHP_FUNCTION(gnupg_adddecryptkey)
phpc_str_size_t passphrase_len; phpc_str_size_t passphrase_len;
gpgme_key_t gpgme_key; gpgme_key_t gpgme_key;
gpgme_subkey_t gpgme_subkey; gpgme_subkey_t gpgme_subkey;
int loopback_set = 0;
GNUPG_GETOBJ(); GNUPG_GETOBJ();
@ -1073,6 +1074,10 @@ PHP_FUNCTION(gnupg_adddecryptkey)
PHPC_HASH_CSTR_ADD_PTR( PHPC_HASH_CSTR_ADD_PTR(
PHPC_THIS->decryptkeys, gpgme_subkey->keyid, PHPC_THIS->decryptkeys, gpgme_subkey->keyid,
passphrase, passphrase_len + 1); 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; gpgme_subkey = gpgme_subkey->next;
} }