From: Werner Koch Date: Tue, 7 Jul 2009 12:38:18 +0000 (+0000) Subject: * engine-gpgsm.c (gpgsm_import): Return an error for unknown data X-Git-Tag: gpgme-1.3.0~59 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3bd2d764170d95cf154ec47d22101d46f68c92f5;p=gpgme.git * engine-gpgsm.c (gpgsm_import): Return an error for unknown data encodings. --- diff --git a/src/ChangeLog b/src/ChangeLog index 56a215d..eca549a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-07-07 Werner Koch + + * engine-gpgsm.c (gpgsm_import): Return an error for unknown data + encodings. + 2009-06-22 Marcus Brinkmann * debug.h: Everywhere, use %p instead of 0x%x to print pointer. diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c index 71ef221..52915d3 100644 --- a/src/engine-gpgsm.c +++ b/src/engine-gpgsm.c @@ -1544,6 +1544,7 @@ gpgsm_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray) { engine_gpgsm_t gpgsm = engine; gpgme_error_t err; + gpgme_data_encoding_t dataenc; if (!gpgsm) return gpg_error (GPG_ERR_INV_VALUE); @@ -1551,10 +1552,18 @@ gpgsm_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray) if (keydata && keyarray) gpg_error (GPG_ERR_INV_VALUE); /* Only one is allowed. */ + dataenc = gpgme_data_get_encoding (keydata); + if (keyarray) { return gpg_error (GPG_ERR_NOT_IMPLEMENTED); } + else if (dataenc == GPGME_DATA_ENCODING_URL + || dataenc == GPGME_DATA_ENCODING_URL0 + || dataenc == GPGME_DATA_ENCODING_URLESC) + { + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + } else { gpgsm->input_cb.data = keydata;