diff options
Diffstat (limited to 'scd')
-rw-r--r-- | scd/ChangeLog | 4 | ||||
-rw-r--r-- | scd/card.c | 5 | ||||
-rw-r--r-- | scd/sc-copykeys.c | 12 |
3 files changed, 12 insertions, 9 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog index fbe8d2fb2..ed6986965 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,7 @@ +2003-07-27 Werner Koch <[email protected]> + + Adjusted for gcry_mpi_print and gcry_mpi_scan API change. + 2003-07-24 Werner Koch <[email protected]> * app-openpgp.c (do_learn_status): Print more status information. diff --git a/scd/card.c b/scd/card.c index 00c190fa1..02b7bfdbf 100644 --- a/scd/card.c +++ b/scd/card.c @@ -196,6 +196,7 @@ card_close (CARD card) return a pointer to value as well as its length in NBYTES. Return NULL if it was not found. Note, that the function does not check whether the value fits into the provided buffer. */ +#ifdef HAVE_OPENSC static const char * find_simple_tlv (const unsigned char *buffer, size_t length, int tag, size_t *nbytes) @@ -228,11 +229,13 @@ find_simple_tlv (const unsigned char *buffer, size_t length, s += len; n -= len; } } +#endif /*HAVE_OPENSC*/ /* Find the ICC Serial Number within the provided BUFFER of LENGTH (which should contain the GDO file) and return it as a hex encoded string and allocated string in SERIAL. Return an error code when the ICCSN was not found. */ +#ifdef HAVE_OPENSC static int find_iccsn (const unsigned char *buffer, size_t length, char **serial) { @@ -271,7 +274,7 @@ find_iccsn (const unsigned char *buffer, size_t length, char **serial) *p = 0; return 0; } - +#endif /*HAVE_OPENSC*/ /* Retrieve the serial number and the time of the last update of the card. The serial number is returned as a malloced string (hex diff --git a/scd/sc-copykeys.c b/scd/sc-copykeys.c index d9a009b33..9caf39a8a 100644 --- a/scd/sc-copykeys.c +++ b/scd/sc-copykeys.c @@ -596,8 +596,7 @@ copykeys (APP app, const char *fname) template = tp = xmalloc (1+2 + 1+1+4 + 1+1+64 + 1+1+64); *tp++ = 0xC0; *tp++ = 4; - n = 4; - rc = gcry_mpi_print (GCRYMPI_FMT_USG, tp, &n, rsa_e); + rc = gcry_mpi_print (GCRYMPI_FMT_USG, tp, 4, &n, rsa_e); if (rc) { log_error ("mpi_print failed: %s\n", gpg_strerror (rc)); @@ -615,8 +614,7 @@ copykeys (APP app, const char *fname) *tp++ = 0xC1; *tp++ = 64; - n = 64; - rc = gcry_mpi_print (GCRYMPI_FMT_USG, tp, &n, rsa_p); + rc = gcry_mpi_print (GCRYMPI_FMT_USG, tp, 64, &n, rsa_p); if (rc) { log_error ("mpi_print failed: %s\n", gpg_strerror (rc)); @@ -627,8 +625,7 @@ copykeys (APP app, const char *fname) *tp++ = 0xC2; *tp++ = 64; - n = 64; - rc = gcry_mpi_print (GCRYMPI_FMT_USG, tp, &n, rsa_q); + rc = gcry_mpi_print (GCRYMPI_FMT_USG, tp, 64, &n, rsa_q); if (rc) { log_error ("mpi_print failed: %s\n", gpg_strerror (rc)); @@ -639,8 +636,7 @@ copykeys (APP app, const char *fname) assert (tp - template == 138); /* (we need the modulus to calculate the fingerprint) */ - n = 128; - rc = gcry_mpi_print (GCRYMPI_FMT_USG, m, &n, rsa_n); + rc = gcry_mpi_print (GCRYMPI_FMT_USG, m, 128, &n, rsa_n); if (rc) { log_error ("mpi_print failed: %s\n", gpg_strerror (rc)); |