Fix CS in gnupg_decrypt

This commit is contained in:
Jakub Zelenka 2016-10-27 20:28:57 +01:00
parent 0e92c34de0
commit 564dc7d003

10
gnupg.c
View file

@ -1420,11 +1420,13 @@ PHP_FUNCTION(gnupg_decrypt)
GNUPG_GETOBJ(); GNUPG_GETOBJ();
if (this) { if (this) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &enctxt, &enctxt_len) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&enctxt, &enctxt_len) == FAILURE) {
return; return;
} }
} else { } else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &res, &enctxt, &enctxt_len) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs",
&res, &enctxt, &enctxt_len) == FAILURE) {
return; return;
} }
GNUPG_RES_FETCH(); GNUPG_RES_FETCH();
@ -1432,7 +1434,7 @@ PHP_FUNCTION(gnupg_decrypt)
gpgme_set_passphrase_cb(PHPC_THIS->ctx, passphrase_decrypt_cb, PHPC_THIS); gpgme_set_passphrase_cb(PHPC_THIS->ctx, passphrase_decrypt_cb, PHPC_THIS);
if ((PHPC_THIS->err = gpgme_data_new_from_mem(&in, enctxt, enctxt_len, 0)) != GPG_ERR_NO_ERROR) { 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");
} }
if ((PHPC_THIS->err = gpgme_data_new(&out)) != GPG_ERR_NO_ERROR) { if ((PHPC_THIS->err = gpgme_data_new(&out)) != GPG_ERR_NO_ERROR) {
@ -1440,7 +1442,7 @@ PHP_FUNCTION(gnupg_decrypt)
gpgme_data_release(in); gpgme_data_release(in);
return; return;
} }
if ((PHPC_THIS->err = gpgme_op_decrypt(PHPC_THIS->ctx, in, out)) != GPG_ERR_NO_ERROR) { if (!PHP_GNUPG_DO(gpgme_op_decrypt(PHPC_THIS->ctx, in, out))) {
if (!PHPC_THIS->errortxt) { if (!PHPC_THIS->errortxt) {
GNUPG_ERR("decrypt failed"); GNUPG_ERR("decrypt failed");
} }