mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
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.
This commit is contained in:
parent
3370164182
commit
deeba405a9
69 changed files with 558 additions and 348 deletions
32
sm/ChangeLog
32
sm/ChangeLog
|
@ -1,3 +1,35 @@
|
|||
2005-06-15 Werner Koch <wk@g10code.com>
|
||||
|
||||
* delete.c (delete_one): Changed FPR to unsigned.
|
||||
* encrypt.c (encrypt_dek): Made ENCVAL unsigned.
|
||||
(gpgsm_encrypt): Ditto.
|
||||
* sign.c (gpgsm_sign): Made SIGVAL unsigned.
|
||||
* base64.c (base64_reader_cb): Need to use some casting to get
|
||||
around signed/unsigned char* warnings.
|
||||
* certcheck.c (gpgsm_check_cms_signature): Ditto.
|
||||
(gpgsm_create_cms_signature): Changed arg R_SIGVAL to unsigned char*.
|
||||
(do_encode_md): Made NFRAME a size_t.
|
||||
* certdump.c (gpgsm_print_serial): Fixed signed/unsigned warning.
|
||||
(gpgsm_dump_serial): Ditto.
|
||||
(gpgsm_format_serial): Ditto.
|
||||
(gpgsm_dump_string): Ditto.
|
||||
(gpgsm_dump_cert): Ditto.
|
||||
(parse_dn_part): Ditto.
|
||||
(gpgsm_print_name2): Ditto.
|
||||
* keylist.c (email_kludge): Ditto.
|
||||
* certreqgen.c (proc_parameters, create_request): Ditto.
|
||||
(create_request): Ditto.
|
||||
* call-agent.c (gpgsm_agent_pksign): Made arg R_BUF unsigned.
|
||||
(struct cipher_parm_s): Made CIPHERTEXT unsigned.
|
||||
(struct genkey_parm_s): Ditto.
|
||||
* server.c (strcpy_escaped_plus): Made arg S signed char*.
|
||||
* fingerprint.c (gpgsm_get_fingerprint): Made ARRAY unsigned.
|
||||
(gpgsm_get_keygrip): Ditto.
|
||||
* keydb.c (keydb_insert_cert): Made DIGEST unsigned.
|
||||
(keydb_update_cert): Ditto.
|
||||
(classify_user_id): Apply cast to signed/unsigned assignment.
|
||||
(hextobyte): Ditto.
|
||||
|
||||
2005-06-01 Werner Koch <wk@g10code.com>
|
||||
|
||||
* misc.c: Include setenv.h.
|
||||
|
|
14
sm/base64.c
14
sm/base64.c
|
@ -95,7 +95,7 @@ struct base64_context_s {
|
|||
|
||||
|
||||
/* The base-64 character list */
|
||||
static unsigned char bintoasc[64] =
|
||||
static char bintoasc[64] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
|
@ -202,8 +202,9 @@ base64_reader_cb (void *cb_value, char *buffer, size_t count, size_t *nread)
|
|||
{
|
||||
/* wait for the header line */
|
||||
parm->linelen = parm->readpos = 0;
|
||||
if (!parm->have_lf || strncmp (parm->line, "-----BEGIN ", 11)
|
||||
|| !strncmp (parm->line+11, "PGP ", 4))
|
||||
if (!parm->have_lf
|
||||
|| strncmp ((char*)parm->line, "-----BEGIN ", 11)
|
||||
|| !strncmp ((char*)parm->line+11, "PGP ", 4))
|
||||
goto next;
|
||||
parm->is_pem = 1;
|
||||
}
|
||||
|
@ -220,8 +221,9 @@ base64_reader_cb (void *cb_value, char *buffer, size_t count, size_t *nread)
|
|||
/* the very first byte does pretty much look like a SEQUENCE tag*/
|
||||
parm->is_pem = 0;
|
||||
}
|
||||
else if ( parm->have_lf && !strncmp (parm->line, "-----BEGIN ", 11)
|
||||
&& strncmp (parm->line+11, "PGP ", 4) )
|
||||
else if ( parm->have_lf
|
||||
&& !strncmp ((char*)parm->line, "-----BEGIN ", 11)
|
||||
&& strncmp ((char *)parm->line+11, "PGP ", 4) )
|
||||
{
|
||||
/* Fixme: we must only compare if the line really starts at
|
||||
the beginning */
|
||||
|
@ -268,7 +270,7 @@ base64_reader_cb (void *cb_value, char *buffer, size_t count, size_t *nread)
|
|||
if (parm->is_pem || parm->is_base64)
|
||||
{
|
||||
if (parm->is_pem && parm->have_lf
|
||||
&& !strncmp (parm->line, "-----END ", 9))
|
||||
&& !strncmp ((char*)parm->line, "-----END ", 9))
|
||||
{
|
||||
parm->identified = 0;
|
||||
parm->linelen = parm->readpos = 0;
|
||||
|
|
|
@ -39,24 +39,27 @@
|
|||
#include "../common/membuf.h"
|
||||
|
||||
|
||||
static ASSUAN_CONTEXT agent_ctx = NULL;
|
||||
static assuan_context_t agent_ctx = NULL;
|
||||
static int force_pipe_server = 0;
|
||||
|
||||
struct cipher_parm_s {
|
||||
ASSUAN_CONTEXT ctx;
|
||||
const char *ciphertext;
|
||||
struct cipher_parm_s
|
||||
{
|
||||
assuan_context_t ctx;
|
||||
const unsigned char *ciphertext;
|
||||
size_t ciphertextlen;
|
||||
};
|
||||
|
||||
struct genkey_parm_s {
|
||||
ASSUAN_CONTEXT ctx;
|
||||
const char *sexp;
|
||||
struct genkey_parm_s
|
||||
{
|
||||
assuan_context_t ctx;
|
||||
const unsigned char *sexp;
|
||||
size_t sexplen;
|
||||
};
|
||||
|
||||
struct learn_parm_s {
|
||||
struct learn_parm_s
|
||||
{
|
||||
int error;
|
||||
ASSUAN_CONTEXT ctx;
|
||||
assuan_context_t ctx;
|
||||
membuf_t *data;
|
||||
};
|
||||
|
||||
|
@ -204,7 +207,7 @@ membuf_data_cb (void *opaque, const void *buffer, size_t length)
|
|||
int
|
||||
gpgsm_agent_pksign (ctrl_t ctrl, const char *keygrip, const char *desc,
|
||||
unsigned char *digest, size_t digestlen, int digestalgo,
|
||||
char **r_buf, size_t *r_buflen )
|
||||
unsigned char **r_buf, size_t *r_buflen )
|
||||
{
|
||||
int rc, i;
|
||||
char *p, line[ASSUAN_LINELENGTH];
|
||||
|
@ -392,7 +395,7 @@ gpgsm_agent_genkey (ctrl_t ctrl,
|
|||
struct genkey_parm_s gk_parm;
|
||||
membuf_t data;
|
||||
size_t len;
|
||||
char *buf;
|
||||
unsigned char *buf;
|
||||
|
||||
*r_pubkey = NULL;
|
||||
rc = start_agent (ctrl);
|
||||
|
|
|
@ -39,7 +39,8 @@ static int
|
|||
do_encode_md (gcry_md_hd_t md, int algo, int pkalgo, unsigned int nbits,
|
||||
gcry_mpi_t *r_val)
|
||||
{
|
||||
int n, nframe;
|
||||
int n;
|
||||
size_t nframe;
|
||||
unsigned char *frame;
|
||||
|
||||
if (pkalgo == GCRY_PK_DSA)
|
||||
|
@ -205,7 +206,7 @@ gpgsm_check_cert_sig (ksba_cert_t issuer_cert, ksba_cert_t cert)
|
|||
log_printf ("\n");
|
||||
}
|
||||
|
||||
rc = gcry_sexp_sscan ( &s_sig, NULL, p, n);
|
||||
rc = gcry_sexp_sscan ( &s_sig, NULL, (char*)p, n);
|
||||
ksba_free (p);
|
||||
if (rc)
|
||||
{
|
||||
|
@ -224,7 +225,7 @@ gpgsm_check_cert_sig (ksba_cert_t issuer_cert, ksba_cert_t cert)
|
|||
gcry_sexp_release (s_sig);
|
||||
return gpg_error (GPG_ERR_BUG);
|
||||
}
|
||||
rc = gcry_sexp_sscan ( &s_pkey, NULL, p, n);
|
||||
rc = gcry_sexp_sscan ( &s_pkey, NULL, (char*)p, n);
|
||||
ksba_free (p);
|
||||
if (rc)
|
||||
{
|
||||
|
@ -278,7 +279,7 @@ gpgsm_check_cms_signature (ksba_cert_t cert, ksba_const_sexp_t sigval,
|
|||
log_error ("libksba did not return a proper S-Exp\n");
|
||||
return gpg_error (GPG_ERR_BUG);
|
||||
}
|
||||
rc = gcry_sexp_sscan (&s_sig, NULL, sigval, n);
|
||||
rc = gcry_sexp_sscan (&s_sig, NULL, (char*)sigval, n);
|
||||
if (rc)
|
||||
{
|
||||
log_error ("gcry_sexp_scan failed: %s\n", gpg_strerror (rc));
|
||||
|
@ -297,7 +298,7 @@ gpgsm_check_cms_signature (ksba_cert_t cert, ksba_const_sexp_t sigval,
|
|||
if (DBG_CRYPTO)
|
||||
log_printhex ("public key: ", p, n);
|
||||
|
||||
rc = gcry_sexp_sscan ( &s_pkey, NULL, p, n);
|
||||
rc = gcry_sexp_sscan ( &s_pkey, NULL, (char*)p, n);
|
||||
ksba_free (p);
|
||||
if (rc)
|
||||
{
|
||||
|
@ -333,7 +334,8 @@ gpgsm_check_cms_signature (ksba_cert_t cert, ksba_const_sexp_t sigval,
|
|||
|
||||
int
|
||||
gpgsm_create_cms_signature (ctrl_t ctrl, ksba_cert_t cert,
|
||||
gcry_md_hd_t md, int mdalgo, char **r_sigval)
|
||||
gcry_md_hd_t md, int mdalgo,
|
||||
unsigned char **r_sigval)
|
||||
{
|
||||
int rc;
|
||||
char *grip, *desc;
|
||||
|
|
|
@ -50,8 +50,9 @@ struct dn_array_s {
|
|||
|
||||
/* print the first element of an S-Expression */
|
||||
void
|
||||
gpgsm_print_serial (FILE *fp, ksba_const_sexp_t p)
|
||||
gpgsm_print_serial (FILE *fp, ksba_const_sexp_t sn)
|
||||
{
|
||||
const char *p = (const char *)sn;
|
||||
unsigned long n;
|
||||
char *endp;
|
||||
|
||||
|
@ -77,8 +78,9 @@ gpgsm_print_serial (FILE *fp, ksba_const_sexp_t p)
|
|||
|
||||
/* Dump the serial number or any other simple S-expression. */
|
||||
void
|
||||
gpgsm_dump_serial (ksba_const_sexp_t p)
|
||||
gpgsm_dump_serial (ksba_const_sexp_t sn)
|
||||
{
|
||||
const char *p = (const char *)sn;
|
||||
unsigned long n;
|
||||
char *endp;
|
||||
|
||||
|
@ -103,8 +105,9 @@ gpgsm_dump_serial (ksba_const_sexp_t p)
|
|||
|
||||
|
||||
char *
|
||||
gpgsm_format_serial (ksba_const_sexp_t p)
|
||||
gpgsm_format_serial (ksba_const_sexp_t sn)
|
||||
{
|
||||
const char *p = (const char *)sn;
|
||||
unsigned long n;
|
||||
char *endp;
|
||||
char *buffer;
|
||||
|
@ -168,7 +171,7 @@ gpgsm_dump_string (const char *string)
|
|||
{
|
||||
const unsigned char *s;
|
||||
|
||||
for (s=string; *s; s++)
|
||||
for (s=(const unsigned char*)string; *s; s++)
|
||||
{
|
||||
if (*s < ' ' || (*s >= 0x7f && *s <= 0xa0))
|
||||
break;
|
||||
|
@ -190,7 +193,7 @@ void
|
|||
gpgsm_dump_cert (const char *text, ksba_cert_t cert)
|
||||
{
|
||||
ksba_sexp_t sexp;
|
||||
unsigned char *p;
|
||||
char *p;
|
||||
char *dn;
|
||||
ksba_isotime_t t;
|
||||
|
||||
|
@ -260,7 +263,7 @@ parse_dn_part (struct dn_array_s *array, const unsigned char *string)
|
|||
};
|
||||
const unsigned char *s, *s1;
|
||||
size_t n;
|
||||
unsigned char *p;
|
||||
char *p;
|
||||
int i;
|
||||
|
||||
/* Parse attributeType */
|
||||
|
@ -306,7 +309,7 @@ parse_dn_part (struct dn_array_s *array, const unsigned char *string)
|
|||
return NULL;
|
||||
for (s1=string; n; s1 += 2, n--, p++)
|
||||
{
|
||||
*p = xtoi_2 (s1);
|
||||
*(unsigned char *)p = xtoi_2 (s1);
|
||||
if (!*p)
|
||||
*p = 0x01; /* Better print a wrong value than truncating
|
||||
the string. */
|
||||
|
@ -351,7 +354,7 @@ parse_dn_part (struct dn_array_s *array, const unsigned char *string)
|
|||
s++;
|
||||
if (hexdigitp (s))
|
||||
{
|
||||
*p++ = xtoi_2 (s);
|
||||
*(unsigned char *)p++ = xtoi_2 (s);
|
||||
s++;
|
||||
}
|
||||
else
|
||||
|
@ -485,23 +488,22 @@ print_dn_parts (FILE *fp, struct dn_array_s *dn, int translate)
|
|||
void
|
||||
gpgsm_print_name2 (FILE *fp, const char *name, int translate)
|
||||
{
|
||||
const unsigned char *s;
|
||||
const unsigned char *s = (const unsigned char *)name;
|
||||
int i;
|
||||
|
||||
s = name;
|
||||
if (!s)
|
||||
{
|
||||
fputs (_("[Error - No name]"), fp);
|
||||
}
|
||||
else if (*s == '<')
|
||||
{
|
||||
const unsigned char *s2 = strchr (s+1, '>');
|
||||
const char *s2 = strchr ( (char*)s+1, '>');
|
||||
if (s2)
|
||||
{
|
||||
if (translate)
|
||||
print_sanitized_utf8_buffer (fp, s + 1, s2 - s - 1, 0);
|
||||
print_sanitized_utf8_buffer (fp, s + 1, s2 - (char*)s - 1, 0);
|
||||
else
|
||||
print_sanitized_buffer (fp, s + 1, s2 - s - 1, 0);
|
||||
print_sanitized_buffer (fp, s + 1, s2 - (char*)s - 1, 0);
|
||||
}
|
||||
}
|
||||
else if (*s == '(')
|
||||
|
|
|
@ -492,7 +492,7 @@ proc_parameters (ctrl_t ctrl,
|
|||
}
|
||||
|
||||
sprintf (numbuf, "%u", nbits);
|
||||
snprintf (keyparms, DIM (keyparms)-1,
|
||||
snprintf ((char*)keyparms, DIM (keyparms)-1,
|
||||
"(6:genkey(3:rsa(5:nbits%d:%s)))", (int)strlen (numbuf), numbuf);
|
||||
rc = gpgsm_agent_genkey (ctrl, keyparms, &public);
|
||||
if (rc)
|
||||
|
@ -627,8 +627,9 @@ create_request (ctrl_t ctrl,
|
|||
{
|
||||
gcry_sexp_t s_pkey;
|
||||
size_t n;
|
||||
unsigned char grip[20], hexgrip[41];
|
||||
char *sigval;
|
||||
unsigned char grip[20];
|
||||
char hexgrip[41];
|
||||
unsigned char *sigval;
|
||||
size_t siglen;
|
||||
|
||||
n = gcry_sexp_canon_len (public, 0, NULL, NULL);
|
||||
|
@ -638,7 +639,7 @@ create_request (ctrl_t ctrl,
|
|||
err = gpg_error (GPG_ERR_BUG);
|
||||
goto leave;
|
||||
}
|
||||
rc = gcry_sexp_sscan (&s_pkey, NULL, public, n);
|
||||
rc = gcry_sexp_sscan (&s_pkey, NULL, (const char*)public, n);
|
||||
if (rc)
|
||||
{
|
||||
log_error ("gcry_sexp_scan failed: %s\n", gpg_strerror (rc));
|
||||
|
|
|
@ -67,7 +67,7 @@ delete_one (CTRL ctrl, const char *username)
|
|||
rc = keydb_get_cert (kh, &cert);
|
||||
if (!rc)
|
||||
{
|
||||
char fpr[20];
|
||||
unsigned char fpr[20];
|
||||
|
||||
gpgsm_get_fingerprint (cert, 0, fpr, NULL);
|
||||
|
||||
|
@ -78,7 +78,7 @@ delete_one (CTRL ctrl, const char *username)
|
|||
else if (!rc)
|
||||
{
|
||||
ksba_cert_t cert2 = NULL;
|
||||
char fpr2[20];
|
||||
unsigned char fpr2[20];
|
||||
|
||||
/* We ignore all duplicated certificates which might have
|
||||
been inserted due to program bugs. */
|
||||
|
|
12
sm/encrypt.c
12
sm/encrypt.c
|
@ -164,10 +164,10 @@ encode_session_key (DEK dek, gcry_sexp_t * r_data)
|
|||
}
|
||||
|
||||
|
||||
/* encrypt the DEK under the key contained in CERT and return it as a
|
||||
canonical S-Exp in encval */
|
||||
/* Encrypt the DEK under the key contained in CERT and return it as a
|
||||
canonical S-Exp in encval. */
|
||||
static int
|
||||
encrypt_dek (const DEK dek, ksba_cert_t cert, char **encval)
|
||||
encrypt_dek (const DEK dek, ksba_cert_t cert, unsigned char **encval)
|
||||
{
|
||||
gcry_sexp_t s_ciph, s_data, s_pkey;
|
||||
int rc;
|
||||
|
@ -189,7 +189,7 @@ encrypt_dek (const DEK dek, ksba_cert_t cert, char **encval)
|
|||
log_error ("libksba did not return a proper S-Exp\n");
|
||||
return gpg_error (GPG_ERR_BUG);
|
||||
}
|
||||
rc = gcry_sexp_sscan (&s_pkey, NULL, buf, len);
|
||||
rc = gcry_sexp_sscan (&s_pkey, NULL, (char*)buf, len);
|
||||
xfree (buf); buf = NULL;
|
||||
if (rc)
|
||||
{
|
||||
|
@ -220,7 +220,7 @@ encrypt_dek (const DEK dek, ksba_cert_t cert, char **encval)
|
|||
gcry_sexp_release (s_ciph);
|
||||
return tmperr;
|
||||
}
|
||||
len = gcry_sexp_sprint (s_ciph, GCRYSEXP_FMT_CANON, buf, len);
|
||||
len = gcry_sexp_sprint (s_ciph, GCRYSEXP_FMT_CANON, (char*)buf, len);
|
||||
assert (len);
|
||||
|
||||
*encval = buf;
|
||||
|
@ -437,7 +437,7 @@ gpgsm_encrypt (CTRL ctrl, CERTLIST recplist, int data_fd, FILE *out_fp)
|
|||
each and store them in the CMS object */
|
||||
for (recpno = 0, cl = recplist; cl; recpno++, cl = cl->next)
|
||||
{
|
||||
char *encval;
|
||||
unsigned char *encval;
|
||||
|
||||
rc = encrypt_dek (dek, cl->cert, &encval);
|
||||
if (rc)
|
||||
|
|
|
@ -42,8 +42,9 @@
|
|||
If there is a problem , the function does never return NULL but a
|
||||
digest of all 0xff.
|
||||
*/
|
||||
char *
|
||||
gpgsm_get_fingerprint (ksba_cert_t cert, int algo, char *array, int *r_len)
|
||||
unsigned char *
|
||||
gpgsm_get_fingerprint (ksba_cert_t cert, int algo,
|
||||
unsigned char *array, int *r_len)
|
||||
{
|
||||
gcry_md_hd_t md;
|
||||
int rc, len;
|
||||
|
@ -140,8 +141,8 @@ gpgsm_get_short_fingerprint (ksba_cert_t cert)
|
|||
key parameters expressed as an canoncial encoded S-Exp. array must
|
||||
be 20 bytes long. returns the array or a newly allocated one if the
|
||||
passed one was NULL */
|
||||
char *
|
||||
gpgsm_get_keygrip (ksba_cert_t cert, char *array)
|
||||
unsigned char *
|
||||
gpgsm_get_keygrip (ksba_cert_t cert, unsigned char *array)
|
||||
{
|
||||
gcry_sexp_t s_pkey;
|
||||
int rc;
|
||||
|
@ -160,7 +161,7 @@ gpgsm_get_keygrip (ksba_cert_t cert, char *array)
|
|||
log_error ("libksba did not return a proper S-Exp\n");
|
||||
return NULL;
|
||||
}
|
||||
rc = gcry_sexp_sscan ( &s_pkey, NULL, p, n);
|
||||
rc = gcry_sexp_sscan ( &s_pkey, NULL, (char*)p, n);
|
||||
xfree (p);
|
||||
if (rc)
|
||||
{
|
||||
|
@ -223,7 +224,7 @@ gpgsm_get_key_algo_info (ksba_cert_t cert, unsigned int *nbits)
|
|||
xfree (p);
|
||||
return 0;
|
||||
}
|
||||
rc = gcry_sexp_sscan (&s_pkey, NULL, p, n);
|
||||
rc = gcry_sexp_sscan (&s_pkey, NULL, (char *)p, n);
|
||||
xfree (p);
|
||||
if (rc)
|
||||
return 0;
|
||||
|
@ -272,7 +273,7 @@ char *
|
|||
gpgsm_get_certid (ksba_cert_t cert)
|
||||
{
|
||||
ksba_sexp_t serial;
|
||||
unsigned char *p;
|
||||
char *p;
|
||||
char *endp;
|
||||
unsigned char hash[20];
|
||||
unsigned long n;
|
||||
|
@ -288,7 +289,7 @@ gpgsm_get_certid (ksba_cert_t cert)
|
|||
serial = ksba_cert_get_serial (cert);
|
||||
if (!serial)
|
||||
return NULL; /* oops: no serial number */
|
||||
p = serial;
|
||||
p = (char *)serial;
|
||||
if (*p != '(')
|
||||
{
|
||||
log_error ("Ooops: invalid serial number\n");
|
||||
|
|
10
sm/gpgsm.h
10
sm/gpgsm.h
|
@ -181,12 +181,12 @@ gpg_error_t gpgsm_status_with_err_code (ctrl_t ctrl, int no, const char *text,
|
|||
gpg_err_code_t ec);
|
||||
|
||||
/*-- fingerprint --*/
|
||||
char *gpgsm_get_fingerprint (ksba_cert_t cert, int algo,
|
||||
char *array, int *r_len);
|
||||
unsigned char *gpgsm_get_fingerprint (ksba_cert_t cert, int algo,
|
||||
unsigned char *array, int *r_len);
|
||||
char *gpgsm_get_fingerprint_string (ksba_cert_t cert, int algo);
|
||||
char *gpgsm_get_fingerprint_hexstring (ksba_cert_t cert, int algo);
|
||||
unsigned long gpgsm_get_short_fingerprint (ksba_cert_t cert);
|
||||
char *gpgsm_get_keygrip (ksba_cert_t cert, char *array);
|
||||
unsigned char *gpgsm_get_keygrip (ksba_cert_t cert, unsigned char *array);
|
||||
char *gpgsm_get_keygrip_hexstring (ksba_cert_t cert);
|
||||
int gpgsm_get_key_algo_info (ksba_cert_t cert, unsigned int *nbits);
|
||||
char *gpgsm_get_certid (ksba_cert_t cert);
|
||||
|
@ -229,7 +229,7 @@ int gpgsm_check_cms_signature (ksba_cert_t cert, ksba_const_sexp_t sigval,
|
|||
/* fixme: move create functions to another file */
|
||||
int gpgsm_create_cms_signature (ctrl_t ctrl,
|
||||
ksba_cert_t cert, gcry_md_hd_t md, int mdalgo,
|
||||
char **r_sigval);
|
||||
unsigned char **r_sigval);
|
||||
|
||||
|
||||
/*-- certchain.c --*/
|
||||
|
@ -293,7 +293,7 @@ int gpgsm_agent_pksign (ctrl_t ctrl, const char *keygrip, const char *desc,
|
|||
unsigned char *digest,
|
||||
size_t digestlen,
|
||||
int digestalgo,
|
||||
char **r_buf, size_t *r_buflen);
|
||||
unsigned char **r_buf, size_t *r_buflen);
|
||||
int gpgsm_agent_pkdecrypt (ctrl_t ctrl, const char *keygrip, const char *desc,
|
||||
ksba_const_sexp_t ciphertext,
|
||||
char **r_buf, size_t *r_buflen);
|
||||
|
|
|
@ -681,7 +681,7 @@ keydb_insert_cert (KEYDB_HANDLE hd, ksba_cert_t cert)
|
|||
{
|
||||
int rc = -1;
|
||||
int idx;
|
||||
char digest[20];
|
||||
unsigned char digest[20];
|
||||
|
||||
if (!hd)
|
||||
return gpg_error (GPG_ERR_INV_VALUE);
|
||||
|
@ -723,7 +723,7 @@ int
|
|||
keydb_update_cert (KEYDB_HANDLE hd, ksba_cert_t cert)
|
||||
{
|
||||
int rc = 0;
|
||||
char digest[20];
|
||||
unsigned char digest[20];
|
||||
|
||||
if (!hd)
|
||||
return gpg_error (GPG_ERR_INV_VALUE);
|
||||
|
@ -1010,8 +1010,9 @@ keydb_search_subject (KEYDB_HANDLE hd, const char *name)
|
|||
|
||||
|
||||
static int
|
||||
hextobyte (const unsigned char *s)
|
||||
hextobyte (const char *string)
|
||||
{
|
||||
const unsigned char *s = (const unsigned char *)string;
|
||||
int c;
|
||||
|
||||
if( *s >= '0' && *s <= '9' )
|
||||
|
@ -1122,7 +1123,7 @@ classify_user_id (const char *name,
|
|||
if (!strchr("01234567890abcdefABCDEF", *si))
|
||||
return 0; /* invalid digit in serial number*/
|
||||
}
|
||||
desc->sn = s;
|
||||
desc->sn = (const unsigned char*)s;
|
||||
desc->snlen = -1;
|
||||
if (!*si)
|
||||
mode = KEYDB_SEARCH_MODE_SN;
|
||||
|
|
|
@ -256,7 +256,7 @@ print_time (gnupg_isotime_t t, FILE *fp)
|
|||
static char *
|
||||
email_kludge (const char *name)
|
||||
{
|
||||
const unsigned char *p;
|
||||
const char *p;
|
||||
unsigned char *buf;
|
||||
int n;
|
||||
|
||||
|
@ -278,7 +278,7 @@ email_kludge (const char *name)
|
|||
buf[n] = xtoi_2 (p);
|
||||
buf[n++] = '>';
|
||||
buf[n] = 0;
|
||||
return buf;
|
||||
return (char*)buf;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,14 +53,14 @@ struct server_local_s {
|
|||
/* Note that it is sufficient to allocate the target string D as
|
||||
long as the source string S, i.e.: strlen(s)+1; */
|
||||
static void
|
||||
strcpy_escaped_plus (char *d, const unsigned char *s)
|
||||
strcpy_escaped_plus (char *d, const char *s)
|
||||
{
|
||||
while (*s)
|
||||
{
|
||||
if (*s == '%' && s[1] && s[2])
|
||||
{
|
||||
s++;
|
||||
*d++ = xtoi_2 ( s);
|
||||
*d++ = xtoi_2 (s);
|
||||
s += 2;
|
||||
}
|
||||
else if (*s == '+')
|
||||
|
|
|
@ -575,7 +575,7 @@ gpgsm_sign (CTRL ctrl, CERTLIST signerlist,
|
|||
ksba_cms_set_hash_function (cms, HASH_FNC, md);
|
||||
for (cl=signerlist,signer=0; cl; cl = cl->next, signer++)
|
||||
{
|
||||
char *sigval = NULL;
|
||||
unsigned char *sigval = NULL;
|
||||
char *buf, *fpr;
|
||||
|
||||
if (signer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue