mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2024-11-22 22:37:10 +00:00
Fix CS in gnupg_encryptsign
This commit is contained in:
parent
fc90732c39
commit
91f392fa9f
1 changed files with 10 additions and 7 deletions
17
gnupg.c
17
gnupg.c
|
@ -1228,8 +1228,8 @@ PHP_FUNCTION(gnupg_encrypt)
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ proto string gnupg_encrypt_sign(string text)
|
/* {{{ proto string gnupg_encrypt_sign(string text)
|
||||||
* encrypts and signs the given text with the keys, which weres set with setencryptkey and setsignkey before
|
* encrypts and signs the given text with the keys, which weres set
|
||||||
* and returns the encrypted text
|
* with setencryptkey and setsignkey before, and returns the encrypted text
|
||||||
*/
|
*/
|
||||||
PHP_FUNCTION(gnupg_encryptsign)
|
PHP_FUNCTION(gnupg_encryptsign)
|
||||||
{
|
{
|
||||||
|
@ -1244,11 +1244,13 @@ PHP_FUNCTION(gnupg_encryptsign)
|
||||||
GNUPG_GETOBJ();
|
GNUPG_GETOBJ();
|
||||||
|
|
||||||
if (this) {
|
if (this) {
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
|
||||||
|
&value, &value_len) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &res, &value, &value_len) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs",
|
||||||
|
&res, &value, &value_len) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GNUPG_RES_FETCH();
|
GNUPG_RES_FETCH();
|
||||||
|
@ -1259,16 +1261,17 @@ PHP_FUNCTION(gnupg_encryptsign)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gpgme_set_passphrase_cb(PHPC_THIS->ctx, passphrase_cb, PHPC_THIS);
|
gpgme_set_passphrase_cb(PHPC_THIS->ctx, passphrase_cb, PHPC_THIS);
|
||||||
if ((PHPC_THIS->err = gpgme_data_new_from_mem (&in, value, value_len, 0)) != GPG_ERR_NO_ERROR) {
|
if (!PHP_GNUPG_DO(gpgme_data_new_from_mem (&in, value, value_len, 0))) {
|
||||||
GNUPG_ERR("could not create in-data buffer");
|
GNUPG_ERR("could not create in-data buffer");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((PHPC_THIS->err = gpgme_data_new(&out)) != GPG_ERR_NO_ERROR) {
|
if (!PHP_GNUPG_DO(gpgme_data_new(&out))) {
|
||||||
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;
|
||||||
}
|
}
|
||||||
if ((PHPC_THIS->err = gpgme_op_encrypt_sign(PHPC_THIS->ctx, PHPC_THIS->encryptkeys, GPGME_ENCRYPT_ALWAYS_TRUST, in, out)) != GPG_ERR_NO_ERROR) {
|
if (!PHP_GNUPG_DO(gpgme_op_encrypt_sign(PHPC_THIS->ctx, PHPC_THIS->encryptkeys,
|
||||||
|
GPGME_ENCRYPT_ALWAYS_TRUST, in, out))) {
|
||||||
if (!PHPC_THIS->errortxt) {
|
if (!PHPC_THIS->errortxt) {
|
||||||
GNUPG_ERR("encrypt-sign failed");
|
GNUPG_ERR("encrypt-sign failed");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue