mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2024-11-22 14:27:09 +00:00
fixed bug in verify + typos
This commit is contained in:
parent
9df69f2cec
commit
05a9819d33
1 changed files with 5 additions and 7 deletions
12
gnupg.c
12
gnupg.c
|
@ -705,7 +705,6 @@ PHP_FUNCTION(gnupg_adddecryptkey){
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
||||||
/* {{{ proto bool gnupg_addencryptkey(string key) */
|
/* {{{ proto bool gnupg_addencryptkey(string key) */
|
||||||
PHP_FUNCTION(gnupg_addencryptkey){
|
PHP_FUNCTION(gnupg_addencryptkey){
|
||||||
char *key_id = NULL;
|
char *key_id = NULL;
|
||||||
|
@ -737,7 +736,7 @@ PHP_FUNCTION(gnupg_addencryptkey){
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ proto bool gnupg_clearsignerkey(void)
|
/* {{{ proto bool gnupg_clearsignerkeys(void)
|
||||||
* removes all keys which are set for signing
|
* removes all keys which are set for signing
|
||||||
*/
|
*/
|
||||||
PHP_FUNCTION(gnupg_clearsignkeys){
|
PHP_FUNCTION(gnupg_clearsignkeys){
|
||||||
|
@ -756,7 +755,7 @@ PHP_FUNCTION(gnupg_clearsignkeys){
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ proto bool gnupg_clearencryptkey(void)
|
/* {{{ proto bool gnupg_clearencryptkeys(void)
|
||||||
* removes all keys which are set for encryption
|
* removes all keys which are set for encryption
|
||||||
*/
|
*/
|
||||||
PHP_FUNCTION(gnupg_clearencryptkeys){
|
PHP_FUNCTION(gnupg_clearencryptkeys){
|
||||||
|
@ -774,7 +773,7 @@ PHP_FUNCTION(gnupg_clearencryptkeys){
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ proto bool gnupg_clearsignerkey(void)
|
/* {{{ proto bool gnupg_clearsignerkeys(void)
|
||||||
* removes all keys which are set for signing
|
* removes all keys which are set for signing
|
||||||
*/
|
*/
|
||||||
PHP_FUNCTION(gnupg_cleardecryptkeys){
|
PHP_FUNCTION(gnupg_cleardecryptkeys){
|
||||||
|
@ -969,7 +968,7 @@ PHP_FUNCTION(gnupg_encryptsign){
|
||||||
PHP_FUNCTION(gnupg_verify){
|
PHP_FUNCTION(gnupg_verify){
|
||||||
char *text;
|
char *text;
|
||||||
int text_len;
|
int text_len;
|
||||||
zval *signature; /* use zval here because the signature can be binary */
|
zval *signature = NULL; /* use zval here because the signature can be binary */
|
||||||
zval *plaintext = NULL;
|
zval *plaintext = NULL;
|
||||||
zval *sig_arr;
|
zval *sig_arr;
|
||||||
|
|
||||||
|
@ -992,8 +991,7 @@ PHP_FUNCTION(gnupg_verify){
|
||||||
}
|
}
|
||||||
ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
|
ZEND_FETCH_RESOURCE(intern,gnupg_object *, &res, -1, "ctx", le_gnupg);
|
||||||
}
|
}
|
||||||
|
if(Z_STRVAL_P(signature)){
|
||||||
if(Z_STRLEN_P(signature) > 0){
|
|
||||||
if((intern->err = gpgme_data_new_from_mem (&gpgme_sig, Z_STRVAL_P(signature), Z_STRLEN_P(signature), 0))!=GPG_ERR_NO_ERROR){
|
if((intern->err = gpgme_data_new_from_mem (&gpgme_sig, Z_STRVAL_P(signature), Z_STRLEN_P(signature), 0))!=GPG_ERR_NO_ERROR){
|
||||||
GNUPG_ERR("could not create signature-databuffer");
|
GNUPG_ERR("could not create signature-databuffer");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue