aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-scd.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-06-16 08:12:03 +0000
committerWerner Koch <[email protected]>2005-06-16 08:12:03 +0000
commitdeeba405a9a5868ea478db5003be6335ab9aac6f (patch)
treed61d720258fd571ec81a3d3e5d776320b7b1d796 /agent/call-scd.c
parentNew debugging optionhs, updates to the manual. (diff)
downloadgnupg-deeba405a9a5868ea478db5003be6335ab9aac6f.tar.gz
gnupg-deeba405a9a5868ea478db5003be6335ab9aac6f.zip
gcc-4 defaults forced me to edit many many files to get rid of the
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
Diffstat (limited to 'agent/call-scd.c')
-rw-r--r--agent/call-scd.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 4dff8e3c1..7a623fda4 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -465,7 +465,7 @@ unescape_status_string (const unsigned char *s)
{
char *buffer, *d;
- buffer = d = xtrymalloc (strlen (s)+1);
+ buffer = d = xtrymalloc (strlen ((const char*)s)+1);
if (!buffer)
return NULL;
while (*s)
@@ -666,7 +666,7 @@ agent_card_pksign (ctrl_t ctrl,
int (*getpin_cb)(void *, const char *, char*, size_t),
void *getpin_cb_arg,
const unsigned char *indata, size_t indatalen,
- char **r_buf, size_t *r_buflen)
+ unsigned char **r_buf, size_t *r_buflen)
{
int rc, i;
char *p, line[ASSUAN_LINELENGTH];
@@ -714,14 +714,11 @@ agent_card_pksign (ctrl_t ctrl,
/* Create an S-expression from it which is formatted like this:
"(7:sig-val(3:rsa(1:sSIGBUFLEN:SIGBUF)))" */
*r_buflen = 21 + 11 + sigbuflen + 4;
- *r_buf = xtrymalloc (*r_buflen);
- if (!*r_buf)
- {
- gpg_error_t tmperr = out_of_core ();
- xfree (*r_buf);
- return unlock_scd (ctrl, tmperr);
- }
- p = stpcpy (*r_buf, "(7:sig-val(3:rsa(1:s" );
+ p = xtrymalloc (*r_buflen);
+ *r_buf = (unsigned char*)p;
+ if (!p)
+ return unlock_scd (ctrl, out_of_core ());
+ p = stpcpy (p, "(7:sig-val(3:rsa(1:s" );
sprintf (p, "%u:", (unsigned int)sigbuflen);
p += strlen (p);
memcpy (p, sigbuf, sigbuflen);
@@ -895,7 +892,7 @@ card_getattr_cb (void *opaque, const char *line)
if (keywordlen == parm->keywordlen
&& !memcmp (keyword, parm->keyword, keywordlen))
{
- parm->data = unescape_status_string (line);
+ parm->data = unescape_status_string ((const unsigned char*)line);
if (!parm->data)
parm->error = errno;
}