1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Remove hacks which are not anymore needed since we now require Libgcrypt 1.4

This commit is contained in:
Werner Koch 2008-09-29 15:02:55 +00:00
parent d62ca1bf4a
commit 7d63aa42e5
27 changed files with 348 additions and 271 deletions

View file

@ -1,3 +1,9 @@
2008-09-29 Werner Koch <wk@g10code.com>
* scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
(GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
change all users.
2008-09-28 Marcus Brinkmann <marcus@g10code.com>
* apdu.c (pcsc_get_status): Fix last change.

View file

@ -2948,7 +2948,7 @@ do_sign (app_t app, const char *keyidstr, int hashalgo,
mse[0] = 4; /* Length of the template. */
mse[1] = 0x80; /* Algorithm reference tag. */
if (hashalgo == GCRY_MD_USER_TLS_MD5SHA1)
if (hashalgo == MD_USER_TLS_MD5SHA1)
mse[2] = 0x01; /* Let card do pkcs#1 0xFF padding. */
else
mse[2] = 0x02; /* RSASSA-PKCS1-v1.5 using SHA1. */
@ -3124,7 +3124,7 @@ do_sign (app_t app, const char *keyidstr, int hashalgo,
if (indatalen == 36)
{
/* No ASN.1 container used. */
if (hashalgo != GCRY_MD_USER_TLS_MD5SHA1)
if (hashalgo != MD_USER_TLS_MD5SHA1)
return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
memcpy (data, indata, indatalen);
}
@ -3187,7 +3187,7 @@ do_sign (app_t app, const char *keyidstr, int hashalgo,
return err;
}
if (hashalgo == GCRY_MD_USER_TLS_MD5SHA1)
if (hashalgo == MD_USER_TLS_MD5SHA1)
err = iso7816_compute_ds (app->slot, data, 36, outdata, outdatalen);
else if (no_data_padding)
err = iso7816_compute_ds (app->slot, data+15, 20, outdata, outdatalen);
@ -3226,7 +3226,7 @@ do_auth (app_t app, const char *keyidstr,
return gpg_error (GPG_ERR_WRONG_KEY_USAGE);
}
algo = indatalen == 36? GCRY_MD_USER_TLS_MD5SHA1 : GCRY_MD_SHA1;
algo = indatalen == 36? MD_USER_TLS_MD5SHA1 : GCRY_MD_SHA1;
return do_sign (app, keyidstr, algo, pincb, pincb_arg,
indata, indatalen, outdata, outdatalen);
}

View file

@ -33,10 +33,10 @@
/* To convey some special hash algorithms we use algorithm numbers
reserved for application use. */
#ifndef GCRY_MD_USER
#define GCRY_MD_USER 1024
#ifndef GCRY_MODULE_ID_USER
#define GCRY_MODULE_ID_USER 1024
#endif
#define GCRY_MD_USER_TLS_MD5SHA1 (GCRY_MD_USER+1)
#define MD_USER_TLS_MD5SHA1 (GCRY_MODULE_ID_USER+1)
/* Maximum length of a digest. */
#define MAX_DIGEST_LEN 36