2002-06-03 Marcus Brinkmann <marcus@g10code.de>
* key.c: Include <ctype.h>. (_gpgme_key_append_name): Skip one more char when processing escaped char. Submitted by Marc Mutz <mutz@kde.org>. Handle hexadecimal encodings. Also reported by Marc. Thanks!
This commit is contained in:
parent
b024a61d89
commit
7892a2a64f
@ -1,3 +1,10 @@
|
|||||||
|
2002-06-03 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* key.c: Include <ctype.h>.
|
||||||
|
(_gpgme_key_append_name): Skip one more char when
|
||||||
|
processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
|
||||||
|
Handle hexadecimal encodings. Also reported by Marc. Thanks!
|
||||||
|
|
||||||
2002-06-02 Marcus Brinkmann <marcus@g10code.de>
|
2002-06-02 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
|
* ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
|
||||||
|
18
gpgme/key.c
18
gpgme/key.c
@ -24,6 +24,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ops.h"
|
#include "ops.h"
|
||||||
@ -627,9 +628,19 @@ _gpgme_key_append_name (GpgmeKey key, const char *s)
|
|||||||
*d++ = '\\';
|
*d++ = '\\';
|
||||||
*d++ = '\0';
|
*d++ = '\0';
|
||||||
}
|
}
|
||||||
else if (s[1] == 'x' && my_isdigit (s[2]) && my_isdigit (s[3]))
|
else if (s[1] == 'x' && isxdigit (s[2]) && isxdigit (s[3]))
|
||||||
|
{
|
||||||
|
int val = hextobyte (&s[2]);
|
||||||
|
if (val == -1)
|
||||||
|
{
|
||||||
|
/* Should not happen. */
|
||||||
|
*d++ = *s++;
|
||||||
|
*d++ = *s++;
|
||||||
|
*d++ = *s++;
|
||||||
|
*d++ = *s++;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
unsigned int val = (s[2]-'0')*16 + (s[3]-'0');
|
|
||||||
if (!val)
|
if (!val)
|
||||||
{
|
{
|
||||||
*d++ = '\\';
|
*d++ = '\\';
|
||||||
@ -637,7 +648,8 @@ _gpgme_key_append_name (GpgmeKey key, const char *s)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
*(byte*)d++ = val;
|
*(byte*)d++ = val;
|
||||||
s += 3;
|
s += 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user