mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
(gpgsm_export): Make sure that we don't export more
than one certificate.
This commit is contained in:
parent
58a722938b
commit
9008835d8a
@ -1,3 +1,8 @@
|
|||||||
|
2004-03-03 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* export.c (gpgsm_export): Make sure that we don't export more
|
||||||
|
than one certificate.
|
||||||
|
|
||||||
2004-03-02 Werner Koch <wk@gnupg.org>
|
2004-03-02 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* export.c (create_duptable, destroy_duptable)
|
* export.c (create_duptable, destroy_duptable)
|
||||||
|
14
sm/export.c
14
sm/export.c
@ -44,7 +44,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* A table tem to store a fingerprint used in a duplicates table. We
|
/* A table to store a fingerprint as used in a duplicates table. We
|
||||||
don't need to hash here because a fingerprint is alrady a perfect
|
don't need to hash here because a fingerprint is alrady a perfect
|
||||||
hash value. This we use the most significant bits to index the
|
hash value. This we use the most significant bits to index the
|
||||||
table and then use a linked list for the overflow. Possible
|
table and then use a linked list for the overflow. Possible
|
||||||
@ -105,8 +105,8 @@ insert_duptable (duptable_t *table, unsigned char *fpr, int *exists)
|
|||||||
|
|
||||||
*exists = 0;
|
*exists = 0;
|
||||||
idx = fpr[0];
|
idx = fpr[0];
|
||||||
#if DUPTABLE_BITS > 16
|
#if DUPTABLE_BITS > 16 || DUPTABLE_BITS < 8
|
||||||
#error cannot handle a table larger than 16 bits
|
#error cannot handle a table larger than 16 bits or smaller than 8 bits
|
||||||
#elif DUPTABLE_BITS > 8
|
#elif DUPTABLE_BITS > 8
|
||||||
idx <<= (DUPTABLE_BITS - 8);
|
idx <<= (DUPTABLE_BITS - 8);
|
||||||
idx |= (fpr[1] & ~(~0 << 4));
|
idx |= (fpr[1] & ~(~0 << 4));
|
||||||
@ -239,6 +239,14 @@ gpgsm_export (CTRL ctrl, STRLIST names, FILE *fp)
|
|||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!exists && count && !ctrl->create_pem)
|
||||||
|
{
|
||||||
|
log_info ("exporting more than one certificate "
|
||||||
|
"is not possible in binary mode\n");
|
||||||
|
log_info ("ignoring other certificates\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!exists)
|
if (!exists)
|
||||||
{
|
{
|
||||||
const unsigned char *image;
|
const unsigned char *image;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user