[svn] GnuPG - r5136 - in branches/STABLE-BRANCH-1-4: g10 keyserver
svn author wk
cvs at cvs.gnupg.org
Wed Sep 2 19:30:54 CEST 2009
Author: wk
Date: 2009-09-02 19:30:53 +0200 (Wed, 02 Sep 2009)
New Revision: 5136
Modified:
branches/STABLE-BRANCH-1-4/g10/ChangeLog
branches/STABLE-BRANCH-1-4/g10/app-openpgp.c
branches/STABLE-BRANCH-1-4/g10/iso7816.c
branches/STABLE-BRANCH-1-4/g10/iso7816.h
branches/STABLE-BRANCH-1-4/keyserver/ChangeLog
branches/STABLE-BRANCH-1-4/keyserver/Makefile.am
Log:
Last minute fixes
Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2009-09-02 15:02:01 UTC (rev 5135)
+++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2009-09-02 17:30:53 UTC (rev 5136)
@@ -1,5 +1,8 @@
2009-09-02 Werner Koch <wk at g10code.com>
+ * app-openpgp.c (do_decipher): Compute required Le.
+ * iso7816.c (iso7816_decipher): Add new arg LE.
+
* compress-bz2.c (do_uncompress): Detect unexpected EOF. Fixes
bug#1011.
Modified: branches/STABLE-BRANCH-1-4/keyserver/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/keyserver/ChangeLog 2009-09-02 15:02:01 UTC (rev 5135)
+++ branches/STABLE-BRANCH-1-4/keyserver/ChangeLog 2009-09-02 17:30:53 UTC (rev 5136)
@@ -1,3 +1,8 @@
+2009-09-02 Werner Koch <wk at g10code.com>
+
+ * Makefile.am (gpgkeys_curl_SOURCES, gpgkeys_ldap_SOURCES)
+ (gpgkeys_finger_SOURCES): Add ksmalloc.c only with non-faked cURL.
+
2009-08-25 Werner Koch <wk at g10code.com>
* ksmalloc.c: New
Modified: branches/STABLE-BRANCH-1-4/g10/app-openpgp.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/app-openpgp.c 2009-09-02 15:02:01 UTC (rev 5135)
+++ branches/STABLE-BRANCH-1-4/g10/app-openpgp.c 2009-09-02 17:30:53 UTC (rev 5136)
@@ -3316,7 +3316,7 @@
const char *s;
int n;
const char *fpr = NULL;
- int exmode;
+ int exmode, le_value;
if (!keyidstr || !*keyidstr || !indatalen)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -3399,16 +3399,22 @@
indatalen = fixuplen + indatalen;
padind = -1; /* Already padded. */
}
-
+
if (app->app_local->cardcap.ext_lc_le && indatalen > 254 )
- exmode = 1; /* Extended length w/o a limit. */
+ {
+ exmode = 1; /* Extended length w/o a limit. */
+ le_value = app->app_local->extcap.max_rsp_data;
+ }
else if (app->app_local->cardcap.cmd_chaining && indatalen > 254)
- exmode = -254; /* Command chaining with max. 254 bytes. */
+ {
+ exmode = -254; /* Command chaining with max. 254 bytes. */
+ le_value = 0;
+ }
else
- exmode = 0;
+ exmode = le_value = 0;
rc = iso7816_decipher (app->slot, exmode,
- indata, indatalen, padind,
+ indata, indatalen, le_value, padind,
outdata, outdatalen);
xfree (fixbuf);
}
Modified: branches/STABLE-BRANCH-1-4/g10/iso7816.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/iso7816.c 2009-09-02 15:02:01 UTC (rev 5135)
+++ branches/STABLE-BRANCH-1-4/g10/iso7816.c 2009-09-02 17:30:53 UTC (rev 5136)
@@ -545,10 +545,11 @@
indicator to be used. It should be 0 if no padding is required, a
value of -1 suppresses the padding byte. On success 0 is returned
and the plaintext is available in a newly allocated buffer stored
- at RESULT with its length stored at RESULTLEN. */
+ at RESULT with its length stored at RESULTLEN. For LE see
+ do_generate_keypair. */
gpg_error_t
iso7816_decipher (int slot, int extended_mode,
- const unsigned char *data, size_t datalen,
+ const unsigned char *data, size_t datalen, int le,
int padind, unsigned char **result, size_t *resultlen)
{
int sw;
@@ -559,6 +560,11 @@
*result = NULL;
*resultlen = 0;
+ if (!extended_mode)
+ le = 256; /* Ignore provided Le and use what apdu_send uses. */
+ else if (le >= 0 && le < 256)
+ le = 256;
+
if (padind >= 0)
{
/* We need to prepend the padding indicator. */
@@ -568,18 +574,18 @@
*buf = padind; /* Padding indicator. */
memcpy (buf+1, data, datalen);
- sw = apdu_send (slot, extended_mode,
- 0x00, CMD_PSO, 0x80, 0x86,
- datalen+1, (char*)buf,
- result, resultlen);
+ sw = apdu_send_le (slot, extended_mode,
+ 0x00, CMD_PSO, 0x80, 0x86,
+ datalen+1, (char*)buf, le,
+ result, resultlen);
xfree (buf);
}
else
{
- sw = apdu_send (slot, extended_mode,
- 0x00, CMD_PSO, 0x80, 0x86,
- datalen, (const char *)data,
- result, resultlen);
+ sw = apdu_send_le (slot, extended_mode,
+ 0x00, CMD_PSO, 0x80, 0x86,
+ datalen, (const char *)data, le,
+ result, resultlen);
}
if (sw != SW_SUCCESS)
{
Modified: branches/STABLE-BRANCH-1-4/g10/iso7816.h
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/iso7816.h 2009-09-02 15:02:01 UTC (rev 5135)
+++ branches/STABLE-BRANCH-1-4/g10/iso7816.h 2009-09-02 17:30:53 UTC (rev 5136)
@@ -99,7 +99,7 @@
unsigned char **result, size_t *resultlen);
gpg_error_t iso7816_decipher (int slot, int extended_mode,
const unsigned char *data, size_t datalen,
- int padind,
+ int le, int padind,
unsigned char **result, size_t *resultlen);
gpg_error_t iso7816_internal_authenticate (int slot, int extended_mode,
const unsigned char *data, size_t datalen,
Modified: branches/STABLE-BRANCH-1-4/keyserver/Makefile.am
===================================================================
--- branches/STABLE-BRANCH-1-4/keyserver/Makefile.am 2009-09-02 15:02:01 UTC (rev 5135)
+++ branches/STABLE-BRANCH-1-4/keyserver/Makefile.am 2009-09-02 17:30:53 UTC (rev 5136)
@@ -28,9 +28,9 @@
noinst_SCRIPTS = gpgkeys_test
gpgkeys_ldap_SOURCES = gpgkeys_ldap.c ksutil.c ksutil.h ksmalloc.c
-gpgkeys_hkp_SOURCES = gpgkeys_hkp.c ksutil.c ksutil.h ksmalloc.c
+gpgkeys_hkp_SOURCES = gpgkeys_hkp.c ksutil.c ksutil.h
gpgkeys_finger_SOURCES = gpgkeys_finger.c ksutil.c ksutil.h
-gpgkeys_curl_SOURCES = gpgkeys_curl.c ksutil.c ksutil.h ksmalloc.c
+gpgkeys_curl_SOURCES = gpgkeys_curl.c ksutil.c ksutil.h
other_libs = $(LIBICONV) $(LIBINTL) $(CAPLIBS)
@@ -45,8 +45,10 @@
gpgkeys_hkp_SOURCES += curl-shim.c curl-shim.h
gpgkeys_hkp_LDADD = ../util/libutil.a @NETLIBS@ @DNSLIBS@ $(other_libs) @GETOPT@ @W32LIBS@
else
+gpgkeys_curl_SOURCES += ksmalloc.c
gpgkeys_curl_CPPFLAGS = @LIBCURL_CPPFLAGS@
gpgkeys_curl_LDADD = ../util/libcompat.a @LIBCURL@ @GETOPT@
+gpgkeys_hkp_SOURCES += ksmalloc.c
gpgkeys_hkp_CPPFLAGS = @LIBCURL_CPPFLAGS@
gpgkeys_hkp_LDADD = ../util/libcompat.a @DNSLIBS@ @LIBCURL@ @GETOPT@
gpgkeys_finger_CPPFLAGS = @LIBCURL_CPPFLAGS@
More information about the Gnupg-commits
mailing list