diff options
Diffstat (limited to 'scd/app-sc-hsm.c')
-rw-r--r-- | scd/app-sc-hsm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scd/app-sc-hsm.c b/scd/app-sc-hsm.c index 56c4ceb07..cc5771e2c 100644 --- a/scd/app-sc-hsm.c +++ b/scd/app-sc-hsm.c @@ -1769,7 +1769,7 @@ verify_pin (app_t app, gpg_error_t (*pincb)(void*, const char *, char **), the ECDSA signature in X9.62 format (SEQ/INT(r)/INT(s)) */ static gpg_error_t -do_sign (app_t app, const char *keyidstr, int hashalgo, +do_sign (app_t app, ctrl_t ctrl, const char *keyidstr, int hashalgo, gpg_error_t (*pincb)(void*, const char *, char **), void *pincb_arg, const void *indata, size_t indatalen, @@ -1806,6 +1806,8 @@ do_sign (app_t app, const char *keyidstr, int hashalgo, unsigned char algoid; int sw; + (void)ctrl; + if (!keyidstr || !*keyidstr) return gpg_error (GPG_ERR_INV_VALUE); @@ -1896,7 +1898,7 @@ do_sign (app_t app, const char *keyidstr, int hashalgo, must match the criteria used for the attribute $AUTHKEYID. See do_sign for calling conventions; there is no HASHALGO, though. */ static gpg_error_t -do_auth (app_t app, const char *keyidstr, +do_auth (app_t app, ctrl_t ctrl, const char *keyidstr, gpg_error_t (*pincb)(void*, const char *, char **), void *pincb_arg, const void *indata, size_t indatalen, @@ -1919,7 +1921,7 @@ do_auth (app_t app, const char *keyidstr, } algo = indatalen == 36? MD_USER_TLS_MD5SHA1 : GCRY_MD_SHA1; - return do_sign (app, keyidstr, algo, pincb, pincb_arg, + return do_sign (app, ctrl, keyidstr, algo, pincb, pincb_arg, indata, indatalen, outdata, outdatalen); } @@ -1968,7 +1970,7 @@ strip_PKCS15_padding(unsigned char *src, int srclen, unsigned char **dst, /* Decrypt a PKCS#1 V1.5 formatted cryptogram using the referenced key. */ static gpg_error_t -do_decipher (app_t app, const char *keyidstr, +do_decipher (app_t app, ctrl_t ctrl, const char *keyidstr, gpg_error_t (*pincb)(void*, const char *, char **), void *pincb_arg, const void *indata, size_t indatalen, @@ -1983,6 +1985,8 @@ do_decipher (app_t app, const char *keyidstr, size_t p1blklen; int sw; + (void)ctrl; + if (!keyidstr || !*keyidstr || !indatalen) return gpg_error (GPG_ERR_INV_VALUE); |