mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2024-11-22 14:27:09 +00:00
make code cleaner than it was I when I started :)
This commit is contained in:
parent
e7cd93ba73
commit
2971456019
1 changed files with 14 additions and 13 deletions
13
gnupg.c
13
gnupg.c
|
@ -1501,12 +1501,13 @@ PHP_FUNCTION(gnupg_messagekeys)
|
||||||
|
|
||||||
if (!PHP_GNUPG_DO(gpgme_data_new_from_mem(&in, enctxt, enctxt_len, 0))) {
|
if (!PHP_GNUPG_DO(gpgme_data_new_from_mem(&in, enctxt, enctxt_len, 0))) {
|
||||||
GNUPG_ERR("could not create in-data buffer");
|
GNUPG_ERR("could not create in-data buffer");
|
||||||
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((PHPC_THIS->err = gpgme_data_new(&out)) != GPG_ERR_NO_ERROR) {
|
if ((PHPC_THIS->err = gpgme_data_new(&out)) != GPG_ERR_NO_ERROR) {
|
||||||
GNUPG_ERR("could not create out-data buffer");
|
GNUPG_ERR("could not create out-data buffer");
|
||||||
gpgme_data_release(in);
|
gpgme_data_release(in);
|
||||||
return;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PHP_GNUPG_DO(gpgme_op_decrypt(PHPC_THIS->ctx, in, out));
|
PHP_GNUPG_DO(gpgme_op_decrypt(PHPC_THIS->ctx, in, out));
|
||||||
|
@ -1516,7 +1517,11 @@ PHP_FUNCTION(gnupg_messagekeys)
|
||||||
gpgme_data_release(in);
|
gpgme_data_release(in);
|
||||||
gpgme_data_release(out);
|
gpgme_data_release(out);
|
||||||
|
|
||||||
if (result->recipients) {
|
if (!result->recipients) {
|
||||||
|
GNUPG_ERR("invalid enctext");
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
PHPC_ARRAY_INIT(return_value);
|
PHPC_ARRAY_INIT(return_value);
|
||||||
|
|
||||||
recipient = result->recipients;
|
recipient = result->recipients;
|
||||||
|
@ -1526,10 +1531,6 @@ PHP_FUNCTION(gnupg_messagekeys)
|
||||||
|
|
||||||
recipient = recipient->next;
|
recipient = recipient->next;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
GNUPG_ERR("invalid enctext");
|
|
||||||
RETVAL_FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
Loading…
Reference in a new issue