From 982105f1ce85c92482def1d66f1f44e438ae5ab6 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 28 Nov 2011 18:11:59 +0100 Subject: Use separate test module for dns-cert.c. * dns-cert.c (get_dns_cert): Factor test code out to ... * t-dns-cert.c: new file. --- common/ChangeLog | 5 +++ common/Makefile.am | 3 +- common/dns-cert.c | 62 ++--------------------------------- common/dns-cert.h | 2 +- common/t-dns-cert.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 62 deletions(-) create mode 100644 common/t-dns-cert.c (limited to 'common') diff --git a/common/ChangeLog b/common/ChangeLog index 54435f4b9..dd7ef5398 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,8 @@ +2011-11-28 Werner Koch + + * dns-cert.c (get_dns_cert): Factor test code out to ... + * t-dns-cert.c: new file. + 2011-10-24 Werner Koch * dotlock.h, dotlock.c: Add alternative to allow distribution of diff --git a/common/Makefile.am b/common/Makefile.am index 555d0881d..7821e0442 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -162,7 +162,7 @@ if HAVE_W32_SYSTEM jnlib_tests += t-w32-reg endif module_tests = t-convert t-percent t-gettime t-sysutils t-sexputil \ - t-session-env t-openpgp-oid t-ssh-utils + t-session-env t-openpgp-oid t-ssh-utils t-dns-cert if !HAVE_W32CE_SYSTEM module_tests += t-exechelp endif @@ -196,3 +196,4 @@ t_exechelp_LDADD = $(t_common_ldadd) t_session_env_LDADD = $(t_common_ldadd) t_openpgp_oid_LDADD = $(t_common_ldadd) t_ssh_utils_LDADD = $(t_common_ldadd) +t_dns_cert_LDADD = $(t_common_ldadd) $(DNSLIBS) diff --git a/common/dns-cert.c b/common/dns-cert.c index 888ffb7b1..db1c7be39 100644 --- a/common/dns-cert.c +++ b/common/dns-cert.c @@ -46,13 +46,13 @@ #define T_CERT 37 #endif -/* ADNS has no support for CERT yes. */ +/* ADNS has no support for CERT yet. */ #define my_adns_r_cert 37 /* Returns -1 on error, 0 for no answer, 1 for PGP provided and 2 for - IPGP provided. Note that this fucntion retruns the first CERT + IPGP provided. Note that this function retruns the first CERT found with a supported type; it is expected that only one CERT record is used. */ int @@ -289,61 +289,3 @@ get_dns_cert (const char *name, size_t max_size, IOBUF *iobuf, return -1; #endif } - - - -/* Test with simon.josefsson.org */ - -#ifdef TEST -int -main(int argc,char *argv[]) -{ - unsigned char *fpr; - size_t fpr_len; - char *url; - int rc; - IOBUF iobuf; - - if(argc!=2) - { - printf("cert-test [name]\n"); - return 1; - } - - printf("CERT lookup on %s\n",argv[1]); - - rc=get_dns_cert (argv[1],16384,&iobuf,&fpr,&fpr_len,&url); - if(rc==-1) - printf("error\n"); - else if(rc==0) - printf("no answer\n"); - else if(rc==1) - { - printf("key found: %d bytes\n",(int)iobuf_get_temp_length(iobuf)); - iobuf_close(iobuf); - } - else if(rc==2) - { - if(fpr) - { - size_t i; - printf("Fingerprint found (%d bytes): ",(int)fpr_len); - for(i=0;i. + */ + +#include +#include +#include +#include + +#include "util.h" +#include "iobuf.h" +#include "dns-cert.h" + + +int +main (int argc, char **argv) +{ + unsigned char *fpr; + size_t fpr_len; + char *url; + int rc; + iobuf_t iobuf; + char const *name; + + if (argc) + { + argc--; + argv++; + } + + if (!argc) + name = "simon.josefsson.org"; + else if (argc == 1) + name = *argv; + else + { + fputs ("usage: t-dns-cert [name]\n", stderr); + return 1; + } + + printf ("CERT lookup on `%s'\n", name); + + rc = get_dns_cert (name, 16384, &iobuf, &fpr, &fpr_len, &url); + if (rc == -1) + fputs ("lookup result: error\n", stdout); + else if (!rc) + fputs ("lookup result: no answer\n", stdout); + else if (rc == 1) + { + printf ("lookup result: %d bytes\n", + (int)iobuf_get_temp_length(iobuf)); + iobuf_close (iobuf); + } + else if (rc == 2) + { + if (fpr) + { + int i; + + printf ("Fingerprint found (%d bytes): ", (int)fpr_len); + for (i = 0; i < fpr_len; i++) + printf ("%02X", fpr[i]); + putchar ('\n'); + } + else + printf ("No fingerprint found\n"); + + if (url) + printf ("URL found: %s\n", url); + else + printf ("No URL found\n"); + + xfree (fpr); + xfree (url); + } + + return 0; +} -- cgit v1.2.3 From f95cb909ba505f03ce81816c23dd58718b8cb6e6 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 28 Nov 2011 18:18:12 +0100 Subject: Increase the default buffer size for DNS certificates. * common/t-dns-cert.c (main): Increase MAX_SIZE to 64k. * g10/keyserver.c (DEFAULT_MAX_CERT_SIZE): Increase from 16k to 64k. --- common/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/ChangeLog b/common/ChangeLog index dd7ef5398..46a61dd7a 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,5 +1,7 @@ 2011-11-28 Werner Koch + * t-dns-cert.c (main): Increase MAX_SIZE to 64k. + * dns-cert.c (get_dns_cert): Factor test code out to ... * t-dns-cert.c: new file. -- cgit v1.2.3 From 295b9e29c5f8fa49a767f9404aaca0afa1f31683 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 28 Nov 2011 18:35:19 +0100 Subject: Re-indented dns-cert.c --- common/dns-cert.c | 243 +++++++++++++++++++++++++++--------------------------- 1 file changed, 122 insertions(+), 121 deletions(-) (limited to 'common') diff --git a/common/dns-cert.c b/common/dns-cert.c index db1c7be39..cd8724a82 100644 --- a/common/dns-cert.c +++ b/common/dns-cert.c @@ -56,8 +56,8 @@ found with a supported type; it is expected that only one CERT record is used. */ int -get_dns_cert (const char *name, size_t max_size, IOBUF *iobuf, - unsigned char **fpr, size_t *fpr_len, char **url) +get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, + unsigned char **fpr, size_t * fpr_len, char **url) { #ifdef USE_DNS_CERT #ifdef USE_ADNS @@ -92,7 +92,7 @@ get_dns_cert (const char *name, size_t max_size, IOBUF *iobuf, return 0; } - for (rc = 0, count=0; !rc && count < answer->nrrs; count++) + for (rc = 0, count = 0; !rc && count < answer->nrrs; count++) { int datalen = answer->rrs.byteblock[count].len; const unsigned char *data = answer->rrs.byteblock[count].data; @@ -100,7 +100,7 @@ get_dns_cert (const char *name, size_t max_size, IOBUF *iobuf, if (datalen < 5) continue; /* Truncated CERT record - skip. */ - ctype = ((data[0]<<8)|data[1]); + ctype = ((data[0] << 8) | data[1]); /* (key tag and algorithm fields are not required.) */ data += 5; datalen -= 5; @@ -109,11 +109,11 @@ get_dns_cert (const char *name, size_t max_size, IOBUF *iobuf, { /* CERT type is PGP. Gpg checks for a minimum length of 11, thus we do the same. */ - *iobuf = iobuf_temp_with_content ((char*)data, datalen); + *iobuf = iobuf_temp_with_content ((char *)data, datalen); rc = 1; } else if (ctype == 6 && datalen && datalen < 1023 - && datalen >= data[0]+1 && fpr && fpr_len && url) + && datalen >= data[0] + 1 && fpr && fpr_len && url) { /* CERT type is IPGP. We made sure tha the data is plausible and that the caller requested the @@ -122,16 +122,16 @@ get_dns_cert (const char *name, size_t max_size, IOBUF *iobuf, if (*fpr_len) { *fpr = xmalloc (*fpr_len); - memcpy (*fpr, data+1, *fpr_len); + memcpy (*fpr, data + 1, *fpr_len); } else *fpr = NULL; if (datalen > *fpr_len + 1) { - *url = xmalloc (datalen - (*fpr_len+1) + 1); - memcpy (*url, data + (*fpr_len+1), datalen - (*fpr_len+1)); - (*url)[datalen - (*fpr_len+1)] = '\0'; + *url = xmalloc (datalen - (*fpr_len + 1) + 1); + memcpy (*url, data + (*fpr_len + 1), datalen - (*fpr_len + 1)); + (*url)[datalen - (*fpr_len + 1)] = '\0'; } else *url = NULL; @@ -147,137 +147,138 @@ get_dns_cert (const char *name, size_t max_size, IOBUF *iobuf, #else /*!USE_ADNS*/ unsigned char *answer; - int r,ret=-1; + int ret = -1; + int r; u16 count; - if(fpr) - *fpr=NULL; + if (fpr) + *fpr = NULL; - if(url) - *url=NULL; + if (url) + *url = NULL; - answer=xmalloc(max_size); + answer = xmalloc (max_size); - r=res_query(name,C_IN,T_CERT,answer,max_size); + r = res_query (name, C_IN, T_CERT, answer, max_size); /* Not too big, not too small, no errors and at least 1 answer. */ - if(r>=sizeof(HEADER) && r<=max_size - && (((HEADER *)answer)->rcode)==NOERROR - && (count=ntohs(((HEADER *)answer)->ancount))) + if (r >= sizeof (HEADER) && r <= max_size + && (((HEADER *) answer)->rcode) == NOERROR + && (count = ntohs (((HEADER *) answer)->ancount))) { int rc; - unsigned char *pt,*emsg; + unsigned char *pt, *emsg; - emsg=&answer[r]; + emsg = &answer[r]; - pt=&answer[sizeof(HEADER)]; + pt = &answer[sizeof (HEADER)]; /* Skip over the query */ - rc=dn_skipname(pt,emsg); - if(rc==-1) - goto fail; + rc = dn_skipname (pt, emsg); + if (rc == -1) + goto fail; - pt+=rc+QFIXEDSZ; + pt += rc + QFIXEDSZ; /* There are several possible response types for a CERT request. - We're interested in the PGP (a key) and IPGP (a URI) types. - Skip all others. TODO: A key is better than a URI since - we've gone through all this bother to fetch it, so favor that - if we have both PGP and IPGP? */ - - while(count-->0 && pt=pt[0]+1 - && fpr && fpr_len && url) - { - /* IPGP type */ - *fpr_len=pt[0]; - - if(*fpr_len) - { - *fpr=xmalloc(*fpr_len); - memcpy(*fpr,&pt[1],*fpr_len); - } - else - *fpr=NULL; - - if(dlen>*fpr_len+1) - { - *url=xmalloc(dlen-(*fpr_len+1)+1); - memcpy(*url,&pt[*fpr_len+1],dlen-(*fpr_len+1)); - (*url)[dlen-(*fpr_len+1)]='\0'; - } - else - *url=NULL; - - ret=2; - break; - } - - /* Neither type matches, so go around to the next answer. */ - pt+=dlen; - } + We're interested in the PGP (a key) and IPGP (a URI) types. + Skip all others. TODO: A key is better than a URI since + we've gone through all this bother to fetch it, so favor that + if we have both PGP and IPGP? */ + + while (count-- > 0 && pt < emsg) + { + u16 type, class, dlen, ctype; + + rc = dn_skipname (pt, emsg); /* the name we just queried for */ + if (rc == -1) + break; + + pt += rc; + + /* Truncated message? 15 bytes takes us to the point where + we start looking at the ctype. */ + if ((emsg - pt) < 15) + break; + + type = *pt++ << 8; + type |= *pt++; + + class = *pt++ << 8; + class |= *pt++; + /* We asked for IN and got something else !? */ + if (class != C_IN) + break; + + /* ttl */ + pt += 4; + + /* data length */ + dlen = *pt++ << 8; + dlen |= *pt++; + + /* We asked for CERT and got something else - might be a + CNAME, so loop around again. */ + if (type != T_CERT) + { + pt += dlen; + continue; + } + + /* The CERT type */ + ctype = *pt++ << 8; + ctype |= *pt++; + + /* Skip the CERT key tag and algo which we don't need. */ + pt += 3; + + dlen -= 5; + + /* 15 bytes takes us to here */ + + if (ctype == 3 && iobuf && dlen) + { + /* PGP type */ + *iobuf = iobuf_temp_with_content ((char *) pt, dlen); + ret = 1; + break; + } + else if (ctype == 6 && dlen && dlen < 1023 && dlen >= pt[0] + 1 + && fpr && fpr_len && url) + { + /* IPGP type */ + *fpr_len = pt[0]; + + if (*fpr_len) + { + *fpr = xmalloc (*fpr_len); + memcpy (*fpr, &pt[1], *fpr_len); + } + else + *fpr = NULL; + + if (dlen > *fpr_len + 1) + { + *url = xmalloc (dlen - (*fpr_len + 1) + 1); + memcpy (*url, &pt[*fpr_len + 1], dlen - (*fpr_len + 1)); + (*url)[dlen - (*fpr_len + 1)] = '\0'; + } + else + *url = NULL; + + ret = 2; + break; + } + + /* Neither type matches, so go around to the next answer. */ + pt += dlen; + } } fail: - xfree(answer); + xfree (answer); return ret; -#endif /*!USE_ADNS*/ +#endif /*!USE_ADNS */ #else /* !USE_DNS_CERT */ (void)name; (void)max_size; -- cgit v1.2.3 From 9dc89de7a840c4a210e64b402094235a72e1c921 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 28 Nov 2011 18:36:21 +0100 Subject: Actually increase buffer size of t-dns-cert.c. --- common/t-dns-cert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/t-dns-cert.c b/common/t-dns-cert.c index a2b14f2c1..f3e8892a7 100644 --- a/common/t-dns-cert.c +++ b/common/t-dns-cert.c @@ -55,7 +55,7 @@ main (int argc, char **argv) printf ("CERT lookup on `%s'\n", name); - rc = get_dns_cert (name, 16384, &iobuf, &fpr, &fpr_len, &url); + rc = get_dns_cert (name, 65536, &iobuf, &fpr, &fpr_len, &url); if (rc == -1) fputs ("lookup result: error\n", stdout); else if (!rc) -- cgit v1.2.3 From d24f41641f5a7c3a9be2a6e585a7e2e5031c01d7 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 29 Nov 2011 13:17:20 +0100 Subject: dns-cert.c: Use constants for better readability. --- common/ChangeLog | 4 ++++ common/dns-cert.c | 29 +++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/common/ChangeLog b/common/ChangeLog index 46a61dd7a..943862af9 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,7 @@ +2011-11-29 Werner Koch + + * dns-cert.c: Use new CERTTYPE_ constants for better readability. + 2011-11-28 Werner Koch * t-dns-cert.c (main): Increase MAX_SIZE to 64k. diff --git a/common/dns-cert.c b/common/dns-cert.c index cd8724a82..9b6c6c893 100644 --- a/common/dns-cert.c +++ b/common/dns-cert.c @@ -1,4 +1,4 @@ -/* dns-cert.c - DNS CERT code +/* dns-cert.c - DNS CERT code (rfc-4398) * Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. * * This file is part of GNUPG. @@ -50,9 +50,21 @@ #define my_adns_r_cert 37 +/* Certificate types according to RFC-4398. */ +#define CERTTYPE_PKIX 1 /* X.509 as per PKIX. */ +#define CERTTYPE_SPKI 2 /* SPKI certificate. */ +#define CERTTYPE_PGP 3 /* OpenPGP packet. */ +#define CERTTYPE_IPKIX 4 /* The URL of an X.509 data object. */ +#define CERTTYPE_ISPKI 5 /* The URL of an SPKI certificate. */ +#define CERTTYPE_IPGP 6 /* The fingerprint and URL of an OpenPGP packet.*/ +#define CERTTYPE_ACPKIX 7 /* Attribute Certificate. */ +#define CERTTYPE_IACPKIX 8 /* The URL of an Attribute Certificate. */ +#define CERTTYPE_URI 253 /* URI private. */ +#define CERTTYPE_OID 254 /* OID private. */ + /* Returns -1 on error, 0 for no answer, 1 for PGP provided and 2 for - IPGP provided. Note that this function retruns the first CERT + IPGP provided. Note that this function returns the first CERT found with a supported type; it is expected that only one CERT record is used. */ int @@ -105,18 +117,18 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, data += 5; datalen -= 5; - if (ctype == 3 && datalen >= 11) + if (ctype == CERTTYPE_PGP && datalen >= 11) { /* CERT type is PGP. Gpg checks for a minimum length of 11, thus we do the same. */ *iobuf = iobuf_temp_with_content ((char *)data, datalen); rc = 1; } - else if (ctype == 6 && datalen && datalen < 1023 + else if (ctype == CERTTYPE_IPGP && datalen && datalen < 1023 && datalen >= data[0] + 1 && fpr && fpr_len && url) { - /* CERT type is IPGP. We made sure tha the data is - plausible and that the caller requested the + /* CERT type is IPGP. We made sure that the data is + plausible and that the caller requested this information. */ *fpr_len = data[0]; if (*fpr_len) @@ -236,14 +248,15 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, /* 15 bytes takes us to here */ - if (ctype == 3 && iobuf && dlen) + if (ctype == CERTTYPE_PGP && iobuf && dlen) { /* PGP type */ *iobuf = iobuf_temp_with_content ((char *) pt, dlen); ret = 1; break; } - else if (ctype == 6 && dlen && dlen < 1023 && dlen >= pt[0] + 1 + else if (ctype == CERTTYPE_IPGP + && dlen && dlen < 1023 && dlen >= pt[0] + 1 && fpr && fpr_len && url) { /* IPGP type */ -- cgit v1.2.3 From 6d5bb8e79dcee868e823de2c4e9d0ec9a9308dda Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 29 Nov 2011 18:02:05 +0100 Subject: Add parameter checks and extend documentation of estream. * estream.c (func_mem_create): Don't set FUNC_REALLOC if GROW is not set. Require FUNC_REALLOC if DATA is NULL and FUNC_FREE is given. --- common/ChangeLog | 4 ++++ common/estream.c | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 10 deletions(-) (limited to 'common') diff --git a/common/ChangeLog b/common/ChangeLog index 943862af9..d5682fc4b 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,5 +1,9 @@ 2011-11-29 Werner Koch + * estream.c (func_mem_create): Don't set FUNC_REALLOC if GROW is + not set. Require FUNC_REALLOC if DATA is NULL and FUNC_FREE is + given. + * dns-cert.c: Use new CERTTYPE_ constants for better readability. 2011-11-28 Werner Koch diff --git a/common/estream.c b/common/estream.c index 8087a6287..20d365a63 100644 --- a/common/estream.c +++ b/common/estream.c @@ -539,7 +539,9 @@ typedef struct estream_cookie_mem supplied buffer with the initial conetnt of the memory buffer. If DATA is NULL, DATA_N and DATA_LEN need to be 0 as well. If DATA is not NULL, DATA_N gives the allocated size of DATA and DATA_LEN the - used length in DATA. */ + used length in DATA. If this fucntion succeeds DATA is now owned + by this function. If GROW is false FUNC_REALLOC is not + required. */ static int func_mem_create (void *ES__RESTRICT *ES__RESTRICT cookie, unsigned char *ES__RESTRICT data, size_t data_n, @@ -557,6 +559,11 @@ func_mem_create (void *ES__RESTRICT *ES__RESTRICT cookie, _set_errno (EINVAL); return -1; } + if (grow && func_free && !func_realloc) + { + _set_errno (EINVAL); + return -1; + } mem_cookie = mem_alloc (sizeof (*mem_cookie)); if (!mem_cookie) @@ -571,7 +578,8 @@ func_mem_create (void *ES__RESTRICT *ES__RESTRICT cookie, mem_cookie->data_len = data_len; mem_cookie->block_size = block_size; mem_cookie->flags.grow = !!grow; - mem_cookie->func_realloc = func_realloc ? func_realloc : mem_realloc; + mem_cookie->func_realloc + = grow? (func_realloc ? func_realloc : mem_realloc) : NULL; mem_cookie->func_free = func_free ? func_free : mem_free; *cookie = mem_cookie; err = 0; @@ -622,7 +630,8 @@ es_func_mem_write (void *cookie, const void *buffer, size_t size) assert (mem_cookie->memory_size >= mem_cookie->offset); nleft = mem_cookie->memory_size - mem_cookie->offset; - /* If we are not allowed to grow limit the size to the left space. */ + /* If we are not allowed to grow the buffer, limit the size to the + left space. */ if (!mem_cookie->flags.grow && size > nleft) size = nleft; @@ -663,6 +672,7 @@ es_func_mem_write (void *cookie, const void *buffer, size_t size) return -1; } + assert (mem_cookie->func_realloc); newbuf = mem_cookie->func_realloc (mem_cookie->memory, newsize); if (!newbuf) return -1; @@ -738,6 +748,7 @@ es_func_mem_seek (void *cookie, off_t *offset, int whence) return -1; } + assert (mem_cookie->func_realloc); newbuf = mem_cookie->func_realloc (mem_cookie->memory, newsize); if (!newbuf) return -1; @@ -2580,23 +2591,33 @@ es_fopen (const char *ES__RESTRICT path, const char *ES__RESTRICT mode) +/* Create a new estream object in memory. If DATA is not NULL this + buffer will be used as the memory buffer; thus after this functions + returns with the success the the memory at DATA belongs to the new + estream. The allocated length of DATA is given by DATA_LEN and its + used length by DATA_N. Usually this is malloced buffer; if a + static buffer is provided, the caller must pass false for GROW and + provide a dummy function for FUNC_FREE. FUNC_FREE and FUNC_REALLOC + allow the caller to provide custom functions for realloc and free + to be used by the new estream object. Note that the realloc + function is also used for initial allocation. If DATA is NULL a + buffer is internally allocated; either using internal function or + those provide by the caller. It is an error to provide a realloc + function but no free function. Providing only a free function is + allowed as long as GROW is false. */ estream_t es_mopen (unsigned char *ES__RESTRICT data, size_t data_n, size_t data_len, unsigned int grow, func_realloc_t func_realloc, func_free_t func_free, const char *ES__RESTRICT mode) { + int create_called = 0; + estream_t stream = NULL; + void *cookie = NULL; unsigned int modeflags; - int create_called; - estream_t stream; - void *cookie; int err; es_syshd_t syshd; - cookie = 0; - stream = NULL; - create_called = 0; - err = parse_mode (mode, &modeflags, NULL); if (err) goto out; -- cgit v1.2.3 From 8cf2356fa8aa1dda644314e6e656b3df1586e297 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 30 Nov 2011 17:03:53 +0100 Subject: * common/estream.c (es_fopenmem_init): New. * common/estream.h (es_fopenmem_init): New. --- common/estream.c | 37 +++++++++++++++++++++++++++++++++++-- common/estream.h | 5 ++++- 2 files changed, 39 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/estream.c b/common/estream.c index 20d365a63..c55c7f26d 100644 --- a/common/estream.c +++ b/common/estream.c @@ -2606,7 +2606,7 @@ es_fopen (const char *ES__RESTRICT path, const char *ES__RESTRICT mode) function but no free function. Providing only a free function is allowed as long as GROW is false. */ estream_t -es_mopen (unsigned char *ES__RESTRICT data, size_t data_n, size_t data_len, +es_mopen (void *ES__RESTRICT data, size_t data_n, size_t data_len, unsigned int grow, func_realloc_t func_realloc, func_free_t func_free, const char *ES__RESTRICT mode) @@ -2657,7 +2657,6 @@ es_fopenmem (size_t memlimit, const char *ES__RESTRICT mode) return NULL; modeflags |= O_RDWR; - if (func_mem_create (&cookie, NULL, 0, 0, BUFFER_BLOCK_SIZE, 1, mem_realloc, mem_free, modeflags, @@ -2672,6 +2671,40 @@ es_fopenmem (size_t memlimit, const char *ES__RESTRICT mode) } + +/* This is the same as es_fopenmem but intializes the memory with a + copy of (DATA,DATALEN). The stream is initally set to the + beginning. If MEMLIMIT is not 0 but shorter than DATALEN it + DATALEN will be used as the value for MEMLIMIT. */ +estream_t +es_fopenmem_init (size_t memlimit, const char *ES__RESTRICT mode, + const void *data, size_t datalen) +{ + estream_t stream; + + if (memlimit && memlimit < datalen) + memlimit = datalen; + + stream = es_fopenmem (memlimit, mode); + if (stream && data && datalen) + { + if (es_writen (stream, data, datalen, NULL)) + { + int saveerrno = errno; + es_fclose (stream); + stream = NULL; + _set_errno (saveerrno); + } + else + { + es_seek (stream, 0L, SEEK_SET, NULL); + es_set_indicators (stream, 0, 0); + } + } + return stream; +} + + estream_t es_fopencookie (void *ES__RESTRICT cookie, diff --git a/common/estream.h b/common/estream.h index 432143fd3..49662766e 100644 --- a/common/estream.h +++ b/common/estream.h @@ -76,6 +76,7 @@ #define es_fopen _ESTREAM_PREFIX(es_fopen) #define es_mopen _ESTREAM_PREFIX(es_mopen) #define es_fopenmem _ESTREAM_PREFIX(es_fopenmem) +#define es_fopenmem_init _ESTREAM_PREFIX(es_fopenmem_init) #define es_fdopen _ESTREAM_PREFIX(es_fdopen) #define es_fdopen_nc _ESTREAM_PREFIX(es_fdopen_nc) #define es_sysopen _ESTREAM_PREFIX(es_sysopen) @@ -262,13 +263,15 @@ int es_init (void); estream_t es_fopen (const char *ES__RESTRICT path, const char *ES__RESTRICT mode); -estream_t es_mopen (unsigned char *ES__RESTRICT data, +estream_t es_mopen (void *ES__RESTRICT data, size_t data_n, size_t data_len, unsigned int grow, void *(*func_realloc) (void *mem, size_t size), void (*func_free) (void *mem), const char *ES__RESTRICT mode); estream_t es_fopenmem (size_t memlimit, const char *ES__RESTRICT mode); +estream_t es_fopenmem_init (size_t memlimit, const char *ES__RESTRICT mode, + const void *data, size_t datalen); estream_t es_fdopen (int filedes, const char *mode); estream_t es_fdopen_nc (int filedes, const char *mode); estream_t es_sysopen (es_syshd_t *syshd, const char *mode); -- cgit v1.2.3 From 31f548a18aed729c05ea367f2d8a8104480430d5 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 30 Nov 2011 17:14:08 +0100 Subject: Rewrite dns-cert.c to not use the gpg-only iobuf stuff. * common/dns-cert.c: Remove iobuf.h. (get_dns_cert): Rename to _get_dns_cert. Remove MAX_SIZE arg. Change iobuf arg to a estream-t. Rewrite function to make use of estream instead of iobuf. Require all parameters. Return an gpg_error_t error instead of the type. Add arg ERRSOURCE. * common/dns-cert.h (get_dns_cert): New macro to pass the error source to _gpg_dns_cert. * common/t-dns-cert.c (main): Adjust for changes in get_dns_cert. * g10/keyserver.c (keyserver_import_cert): Ditto. * doc/gpg.texi (GPG Configuration Options): Remove max-cert-size. --- common/ChangeLog | 15 ++++ common/dns-cert.c | 195 +++++++++++++++++++++++++++++++++------------------- common/dns-cert.h | 9 ++- common/t-dns-cert.c | 32 +++++---- 4 files changed, 162 insertions(+), 89 deletions(-) (limited to 'common') diff --git a/common/ChangeLog b/common/ChangeLog index d5682fc4b..96e4e31a2 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,18 @@ +2011-11-30 Werner Koch + + Rewrite dns-cert.c to not use the gpg-only iobuf stuff. + * dns-cert.c: Remove iobuf.h. + (get_dns_cert): Rename to _get_dns_cert. Remove MAX_SIZE arg. + Change iobuf arg to a estream-t. Rewrite function to make use of + estream instead of iobuf. Require all parameters. Return an + gpg_error_t error instead of the type. Add arg ERRSOURCE. + * dns-cert.h (get_dns_cert): New macro to pass the error source to + _gpg_dns_cert. + * t-dns-cert.c (main): Adjust for changes in get_dns_cert. + + * estream.c (es_fopenmem_init): New. + * estream.h (es_fopenmem_init): New. + 2011-11-29 Werner Koch * estream.c (func_mem_create): Don't set FUNC_REALLOC if GROW is diff --git a/common/dns-cert.c b/common/dns-cert.c index 9b6c6c893..56af13a1d 100644 --- a/common/dns-cert.c +++ b/common/dns-cert.c @@ -37,7 +37,6 @@ #endif #include "util.h" -#include "iobuf.h" #include "dns-cert.h" /* Not every installation has gotten around to supporting CERTs @@ -63,48 +62,58 @@ #define CERTTYPE_OID 254 /* OID private. */ -/* Returns -1 on error, 0 for no answer, 1 for PGP provided and 2 for - IPGP provided. Note that this function returns the first CERT - found with a supported type; it is expected that only one CERT - record is used. */ -int -get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, - unsigned char **fpr, size_t * fpr_len, char **url) +/* Returns 0 on success or an error code. If a PGP CERT record was + found, a new estream with that key will be returned at R_KEY and + the other return parameters are set to NULL/0. If an IPGP CERT + record was found the fingerprint is stored as an allocated block at + R_FPR and its length at R_FPRLEN; an URL is is allocated as a + string and returned at R_URL. Note that this function returns the + first CERT found with a supported type; it is expected that only + one CERT record is used. */ +gpg_error_t +_get_dns_cert (const char *name, estream_t *r_key, + unsigned char **r_fpr, size_t *r_fprlen, char **r_url, + gpg_err_source_t errsource) { #ifdef USE_DNS_CERT #ifdef USE_ADNS + gpg_error_t err; adns_state state; adns_answer *answer = NULL; - int rc; unsigned int ctype; int count; - rc = adns_init (&state, adns_if_noerrprint, NULL); - if (rc) + *r_key = NULL; + *r_fpr = NULL; + *r_fprlen = 0; + *r_url = NULL; + + if (adns_init (&state, adns_if_noerrprint, NULL)) { + err = gpg_err_make (errsource, gpg_err_code_from_syserror ()); log_error ("error initializing adns: %s\n", strerror (errno)); - return -1; + return err; } - rc = adns_synchronous (state, name, (adns_r_unknown | my_adns_r_cert), - adns_qf_quoteok_query, &answer); - if (rc) + if (adns_synchronous (state, name, (adns_r_unknown | my_adns_r_cert), + adns_qf_quoteok_query, &answer)) { + err = gpg_err_make (errsource, gpg_err_code_from_syserror ()); /* log_error ("DNS query failed: %s\n", strerror (errno)); */ adns_finish (state); - return -1; + return err; } if (answer->status != adns_s_ok) { /* log_error ("DNS query returned an error: %s (%s)\n", */ /* adns_strerror (answer->status), */ /* adns_errabbrev (answer->status)); */ - adns_free (answer); - adns_finish (state); - return 0; + err = gpg_err_make (errsource, GPG_ERR_NOT_FOUND); + goto leave; } - for (rc = 0, count = 0; !rc && count < answer->nrrs; count++) + err = gpg_err_make (errsource, GPG_ERR_NOT_FOUND); + for (count = 0; count < answer->nrrs; count++) { int datalen = answer->rrs.byteblock[count].len; const unsigned char *data = answer->rrs.byteblock[count].data; @@ -121,8 +130,12 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, { /* CERT type is PGP. Gpg checks for a minimum length of 11, thus we do the same. */ - *iobuf = iobuf_temp_with_content ((char *)data, datalen); - rc = 1; + *r_key = es_fopenmem_init (0, "rwb", data, datalen); + if (!*r_key) + err = gpg_err_make (errsource, gpg_err_code_from_syserror ()); + else + err = 0; + goto leave; } else if (ctype == CERTTYPE_IPGP && datalen && datalen < 1023 && datalen >= data[0] + 1 && fpr && fpr_len && url) @@ -130,50 +143,68 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, /* CERT type is IPGP. We made sure that the data is plausible and that the caller requested this information. */ - *fpr_len = data[0]; - if (*fpr_len) + *r_fprlen = data[0]; + if (*r_fprlen) { - *fpr = xmalloc (*fpr_len); - memcpy (*fpr, data + 1, *fpr_len); + *r_fpr = xtrymalloc (*r_fprlen); + if (!*r_fpr) + { + err = gpg_err_make (errsource, gpg_err_code_from_syserror ()); + goto leave; + } + memcpy (*r_fpr, data + 1, *r_fprlen); } else - *fpr = NULL; + *r_fpr = NULL; - if (datalen > *fpr_len + 1) + if (datalen > *r_fprlen + 1) { - *url = xmalloc (datalen - (*fpr_len + 1) + 1); - memcpy (*url, data + (*fpr_len + 1), datalen - (*fpr_len + 1)); - (*url)[datalen - (*fpr_len + 1)] = '\0'; + *url = xtrymalloc (datalen - (*r_fprlen + 1) + 1); + if (!*r_url) + { + err = gpg_err_make (errsource, gpg_err_code_from_syserror ()); + xfree (*r_fpr); + *r_fpr = NULL; + goto leave; + } + memcpy (*url, data + (*r_fprlen + 1), datalen - (*r_fprlen + 1)); + (*url)[datalen - (*r_fprlen + 1)] = '\0'; } else - *url = NULL; + *r_url = NULL; - rc = 2; + err = 0; + goto leave; } } + leave: adns_free (answer); adns_finish (state); - return rc; + return err; #else /*!USE_ADNS*/ + gpg_error_t err; unsigned char *answer; - int ret = -1; int r; u16 count; - if (fpr) - *fpr = NULL; + *r_key = NULL; + *r_fpr = NULL; + *r_fprlen = 0; + *r_url = NULL; - if (url) - *url = NULL; + /* Allocate a 64k buffer which is the limit for an DNS response. */ + answer = xtrymalloc (65536); + if (!answer) + return gpg_err_make (errsource, gpg_err_code_from_syserror ()); - answer = xmalloc (max_size); + err = gpg_err_make (errsource, GPG_ERR_NOT_FOUND); - r = res_query (name, C_IN, T_CERT, answer, max_size); + r = res_query (name, C_IN, T_CERT, answer, 65536); /* Not too big, not too small, no errors and at least 1 answer. */ - if (r >= sizeof (HEADER) && r <= max_size + if (r >= sizeof (HEADER) && r <= 65536 && (((HEADER *) answer)->rcode) == NOERROR && (count = ntohs (((HEADER *) answer)->ancount))) { @@ -188,8 +219,10 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, rc = dn_skipname (pt, emsg); if (rc == -1) - goto fail; - + { + err = gpg_err_make (errsource, GPG_ERR_INV_OBJ); + goto leave; + } pt += rc + QFIXEDSZ; /* There are several possible response types for a CERT request. @@ -204,7 +237,10 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, rc = dn_skipname (pt, emsg); /* the name we just queried for */ if (rc == -1) - break; + { + err = gpg_err_make (errsource, GPG_ERR_INV_OBJ); + goto leave; + } pt += rc; @@ -248,39 +284,54 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, /* 15 bytes takes us to here */ - if (ctype == CERTTYPE_PGP && iobuf && dlen) + if (ctype == CERTTYPE_PGP && dlen) { /* PGP type */ - *iobuf = iobuf_temp_with_content ((char *) pt, dlen); - ret = 1; - break; + *r_key = es_fopenmem_init (0, "rwb", pt, dlen); + if (!*r_key) + err = gpg_err_make (errsource, gpg_err_code_from_syserror ()); + else + err = 0; + goto leave; } else if (ctype == CERTTYPE_IPGP - && dlen && dlen < 1023 && dlen >= pt[0] + 1 - && fpr && fpr_len && url) + && dlen && dlen < 1023 && dlen >= pt[0] + 1) { /* IPGP type */ - *fpr_len = pt[0]; - - if (*fpr_len) + *r_fprlen = pt[0]; + if (*r_fprlen) { - *fpr = xmalloc (*fpr_len); - memcpy (*fpr, &pt[1], *fpr_len); + *r_fpr = xtrymalloc (*r_fprlen); + if (!*r_fpr) + { + err = gpg_err_make (errsource, + gpg_err_code_from_syserror ()); + goto leave; + } + memcpy (*r_fpr, &pt[1], *r_fprlen); } else - *fpr = NULL; + *r_fpr = NULL; - if (dlen > *fpr_len + 1) + if (dlen > *r_fprlen + 1) { - *url = xmalloc (dlen - (*fpr_len + 1) + 1); - memcpy (*url, &pt[*fpr_len + 1], dlen - (*fpr_len + 1)); - (*url)[dlen - (*fpr_len + 1)] = '\0'; + *r_url = xtrymalloc (dlen - (*r_fprlen + 1) + 1); + if (!*r_fpr) + { + err = gpg_err_make (errsource, + gpg_err_code_from_syserror ()); + xfree (*r_fpr); + *r_fpr = NULL; + goto leave; + } + memcpy (*r_url, &pt[*r_fprlen + 1], dlen - (*r_fprlen + 1)); + (*r_url)[dlen - (*r_fprlen + 1)] = '\0'; } else - *url = NULL; + *r_url = NULL; - ret = 2; - break; + err = 0; + goto leave; } /* Neither type matches, so go around to the next answer. */ @@ -288,18 +339,18 @@ get_dns_cert (const char *name, size_t max_size, IOBUF * iobuf, } } - fail: + leave: xfree (answer); - return ret; + return err; + #endif /*!USE_ADNS */ #else /* !USE_DNS_CERT */ (void)name; - (void)max_size; - (void)iobuf; - (void)fpr; - (void)fpr_len; - (void)url; + (void)r_key; + (void)r_fpr; + (void)r_fprlen; + (void)r_url; - return -1; + return gpg_err_make (errsource, GPG_ERR_NOT_SUPPORTED); #endif } diff --git a/common/dns-cert.h b/common/dns-cert.h index ebfeec838..a1d3d86da 100644 --- a/common/dns-cert.h +++ b/common/dns-cert.h @@ -19,8 +19,13 @@ #ifndef GNUPG_COMMON_DNS_CERT_H #define GNUPG_COMMON_DNS_CERT_H -int get_dns_cert (const char *name, size_t max_size, iobuf_t *iobuf, - unsigned char **fpr, size_t *fpr_len, char **url); +gpg_error_t _get_dns_cert (const char *name, estream_t *r_key, + unsigned char **r_fpr, size_t *r_fprlen, + char **r_url, + gpg_err_source_t errsource); +#define get_dns_cert(a,b,c,d,e) \ + _get_dns_cert ((a),(b),(c),(d),(e), GPG_ERR_SOURCE_DEFAULT); + #endif /*GNUPG_COMMON_DNS_CERT_H*/ diff --git a/common/t-dns-cert.c b/common/t-dns-cert.c index f3e8892a7..1dcae6f29 100644 --- a/common/t-dns-cert.c +++ b/common/t-dns-cert.c @@ -23,18 +23,17 @@ #include #include "util.h" -#include "iobuf.h" #include "dns-cert.h" int main (int argc, char **argv) { + gpg_error_t err; unsigned char *fpr; size_t fpr_len; char *url; - int rc; - iobuf_t iobuf; + estream_t key; char const *name; if (argc) @@ -55,18 +54,19 @@ main (int argc, char **argv) printf ("CERT lookup on `%s'\n", name); - rc = get_dns_cert (name, 65536, &iobuf, &fpr, &fpr_len, &url); - if (rc == -1) - fputs ("lookup result: error\n", stdout); - else if (!rc) - fputs ("lookup result: no answer\n", stdout); - else if (rc == 1) + err = get_dns_cert (name, &key, &fpr, &fpr_len, &url); + if (err) + printf ("get_dns_cert failed: %s <%s>\n", + gpg_strerror (err), gpg_strsource (err)); + else if (key) { - printf ("lookup result: %d bytes\n", - (int)iobuf_get_temp_length(iobuf)); - iobuf_close (iobuf); + int count = 0; + + while (es_getc (key) != EOF) + count++; + printf ("Key found (%d bytes)\n", count); } - else if (rc == 2) + else { if (fpr) { @@ -85,9 +85,11 @@ main (int argc, char **argv) else printf ("No URL found\n"); - xfree (fpr); - xfree (url); } + es_fclose (key); + xfree (fpr); + xfree (url); + return 0; } -- cgit v1.2.3 From 2336b09779d313c1594acf6df3bd8a8486e90458 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 1 Dec 2011 10:51:36 +0100 Subject: Generate the ChangeLog from commit logs. * scripts/gitlog-to-changelog: New script. Taken from gnulib. * scripts/git-log-fix: New file. * scripts/git-log-footer: New file. * doc/HACKING: Describe the ChangeLog policy * ChangeLog: New file. * Makefile.am (EXTRA_DIST): Add new files. (gen-ChangeLog): New. (dist-hook): Run gen-ChangeLog. Rename all ChangeLog files to ChangeLog-2011. --- common/ChangeLog | 2483 ----------------------------------------------- common/ChangeLog-2011 | 2494 ++++++++++++++++++++++++++++++++++++++++++++++++ common/ChangeLog.jnlib | 11 + common/Makefile.am | 2 +- 4 files changed, 2506 insertions(+), 2484 deletions(-) delete mode 100644 common/ChangeLog create mode 100644 common/ChangeLog-2011 (limited to 'common') diff --git a/common/ChangeLog b/common/ChangeLog deleted file mode 100644 index 96e4e31a2..000000000 --- a/common/ChangeLog +++ /dev/null @@ -1,2483 +0,0 @@ -2011-11-30 Werner Koch - - Rewrite dns-cert.c to not use the gpg-only iobuf stuff. - * dns-cert.c: Remove iobuf.h. - (get_dns_cert): Rename to _get_dns_cert. Remove MAX_SIZE arg. - Change iobuf arg to a estream-t. Rewrite function to make use of - estream instead of iobuf. Require all parameters. Return an - gpg_error_t error instead of the type. Add arg ERRSOURCE. - * dns-cert.h (get_dns_cert): New macro to pass the error source to - _gpg_dns_cert. - * t-dns-cert.c (main): Adjust for changes in get_dns_cert. - - * estream.c (es_fopenmem_init): New. - * estream.h (es_fopenmem_init): New. - -2011-11-29 Werner Koch - - * estream.c (func_mem_create): Don't set FUNC_REALLOC if GROW is - not set. Require FUNC_REALLOC if DATA is NULL and FUNC_FREE is - given. - - * dns-cert.c: Use new CERTTYPE_ constants for better readability. - -2011-11-28 Werner Koch - - * t-dns-cert.c (main): Increase MAX_SIZE to 64k. - - * dns-cert.c (get_dns_cert): Factor test code out to ... - * t-dns-cert.c: new file. - -2011-10-24 Werner Koch - - * dotlock.h, dotlock.c: Add alternative to allow distribution of - these files under a modified BSD license - -2011-09-30 Werner Koch - - Change the license of all JNLIB parts from LPGLv3+ to to LGPLv3+ - or GPLv2+. - - * dotlock.h (DOTLOCK_EXT_SYM_PREFIX): New macro. - -2011-09-29 Werner Koch - - * dotlock.c (DOTLOCK_USE_PTHREAD): New macro. - [DOTLOCK_USE_PTHREAD] (all_lockfiles_mutex): New. - (LOCK_all_lockfiles, UNLOCK_all_lockfiles): New. Use them to - protect access to all_lockfiles. - (dotlock_set_fd, dotlock_get_fd): New. - -2011-09-28 Werner Koch - - * dotlock.c (dotlock_take, dotlock_take_unix, dotlock_take_w32): - Implement arbitrary timeout values. - (dotlock_create): Add arg FLAGS for future extensions. - -2011-09-27 Werner Koch - - * dotlock.c (dotlock_take_unix): Check only the link count and not - the error return from link. - (use_hardlinks_p): New. - (dotlock_create_unix): Test for hardlinks. - (dotlock_take_unix): Implement O_EXCL locking. - -2011-09-23 Werner Koch - - * dotlock.c: Factor Unix and W32 specific code out into specific - functions. Define HAVE_POSIX_SYSTEM. Rearrange some functions. - (disable_dotlock): Rename to dotlock_disable. - (create_dotlock): Rename to dotlock_create. - (destroy_dotlock): Rename to dotlock_destroy. - (make_dotlock): Rename to dotlock_take. - (release_dotlock): Rename to dotlock_release. - -2011-09-22 Werner Koch - - * dotlock.c: Remove support for RISCOS. - -2011-08-10 Werner Koch - - * t-exechelp.c (test_close_all_fds): Don't use the DUMMY_FD var. - - * pka.c (get_pka_info): Remove unused var. - - * signal.c (got_fatal_signal): Remove unused var. - - * estream.c (es_fread, es_fwrite): Remove unused var. - -2011-07-20 Werner Koch - - * ssh-utils.c, ssh-utils.h: New. - * t-ssh-utils.c: New. - * Makefile.am (t_ssh_utils_LDADD): New. - (module_tests): Add t-ssh-utils.c - -2011-06-01 Marcus Brinkmann - - * util.h: Undef snprintf before redefining it. - -2011-05-20 Werner Koch - - * util.h: Remove some error code substitutes. - -2011-04-25 Werner Koch - - * userids.c (classify_user_id): Add arg OPENPGP_HACK to fix - regression from 2009-12-08. - -2011-04-01 Werner Koch - - * sysutils.c (get_uint_nonce): New. - -2011-03-03 Werner Koch - - * estream.c (struct estream_list): Rename to estream_list_s and - simplify. A double linked list is overkill for our purpose. - (do_list_add, do_list_remove): Adjust accordingly. - (_es_get_std_stream): Ditto. - (do_list_iterate, estream_iterator_t): Remove; it is used only at - one place. - (es_fflush): Replace iteration function. Also lock each stream - while flushing all streams. - -2011-02-27 Werner Koch - - * gettime.c (isotime2epoch): Factor check code out to .. - (isotime_p): .. new. - (isotime_human_p): New. - (string2isotime): New. - * t-gettime.c (test_string2isotime): New. - -2011-02-11 Andrey Jivsov - - * openpgp-oid.c (openpgp_oid_to_str): Use unsigned int for - get_opaque. Fixes a bug on 64 bit platforms. - -2011-02-08 Werner Koch - - * http.c (connect_server): Add arg R_HOST_NOT_FOUND. - -2011-02-07 Werner Koch - - * http.c (my_socket_new, my_socket_ref, my_socket_unref): New. - (cookie_close, cookie_read, cookie_write, http_close, _http_open) - (send_request): Replace use of an socket integer by the new socket - object. - (_http_raw_connect): New. - (fp_onclose_notification): New. - (_http_raw_connect, _http_wait_response, http_close): Register and - unregister this notification. - * http.h (http_raw_connect): New. - - * http.h (parsed_uri_s): Add field IS_OPAQUE. - (http_req_t): Add HTTP_REQ_OPAQUE. - * http.c (do_parse_uri): Parse unknown schemes into PATH. - (my_socket_new, my_socket_ref, my_socket_unref): New. - (send_request): Simplify save_errno stuff. - -2011-02-03 Werner Koch - - * status.h (STATUS_DECRYPTION_INFO): New. - - * argparse.c (strusage): Update copyright year. - -2011-01-31 Werner Koch - - * openpgp-oid.c: New. - * t-openpgp-oid.c: New. - -2011-01-20 Werner Koch - - Fix bug#1313. - - * http.c (my_select): New. Define to pth_select if building with Pth. - (start_server, write_server, cookie_read, cookie_write): Use it. - (my_connect): New. Define to pth_connect if building with Pth. - (connect_server): Use it. - (my_accept): New. Define to pth_accept if building with Pth. - (start_server): Use it. - -2011-01-20 Werner Koch - - * util.h (struct b64state): Add field LASTERR. - * b64enc.c (enc_start, b64enc_write, b64enc_finish): Handle - LASTERR. This is to make sure that we don't leak strduped data. - * b64dec.c (b64dec_start, b64dec_proc, b64dec_finish): Ditto. - - * http.c (escape_data): New. - (insert_escapes): Implement using escape_data. - (http_escape_data): New. - -2011-01-19 Werner Koch - - * homedir.c (gnupg_module_name): Use NAME_OF_INSTALLED_GPG instead - of "gpg2". - -2011-01-18 Werner Koch - - * iobuf.c (file_es_filter_ctx_t): New. - (file_es_filter): New. - (iobuf_esopen): New. - - * membuf.c (clear_membuf, peek_membuf): New. - - * util.h (GPG_ERR_NO_KEYSERVER): New. - - * keyserver.h (keyserver_spec): Move from ../g10/options.h to here. - - * http.c (do_parse_uri): Add arg NO_SCHEME_CHECK. Change all - callers. Support HKP and HKPS. - (_http_parse_uri): Do proper error management. - * http.h (parsed_uri_s): Add field IS_HTTP. - (http_parse_uri): Support NO_SCHEME_CHECK arg. - - * estream.c (es_func_mem_write): Fix computation of NEWSIZE. - -2011-01-10 Werner Koch - - * session-env.c (update_var): Fix same value detection. Fixes - bug#1311. - -2010-12-17 Werner Koch - - * asshelp.c (lock_spawning): Add arg VERBOSE. Improve timeout - management. Make callers pass a value for VERBOSE. - (lock_agent_spawning, unlock_agent_spawning): Remove. Change - callers to use lock_spawning and unlock_spawning. - -2010-12-17 Marcus Brinkmann - - * homedir.c (gnupg_cachedir): Create /temp subdirectories. - -2010-12-02 Werner Koch - - * miscellaneous.c (gnupg_cipher_algo_name): New. Replace all - users of gcry_cipher_algo_name by this one. - - * logging.c (fun_cookie_s) [W32CE]: Add field USE_WRITEFILE. - (fun_writer) [W32CE]: Make use of it. - (set_file_fd) [W32CE]: Implement special filename "GPG2:". - -2010-11-25 Werner Koch - - * asshelp.c (start_new_gpg_agent): Change style of startup info. - (start_new_dirmngr): Ditto. - -2010-11-23 Werner Koch - - * asshelp.c (SECS_TO_WAIT_FOR_AGENT, SECS_TO_WAIT_FOR_DIRMNGR): - Use these constants. For W32CE increase them to 30 seconds. - (start_new_gpg_agent): Print time to startup agent. - (start_new_dirmngr): Ditto. - -2010-11-04 Werner Koch - - * logging.c (do_logv) [W32]: Don't set a default log stream if the - registry entry is empty. - -2010-10-27 Werner Koch - - * gettime.c (gnupg_get_isotime): Compare to (time_t)-1. - (epoch2isotime): Ditto. - (IS_INVALID_TIME_T): New. - (asctimestamp): Use new macro. - (strtimestamp, isotimestamp): Ditto. Use snprintf. - -2010-10-25 Werner Koch - - * logging.c (do_log): Rename to log_log and make global. - -2010-10-20 Werner Koch - - * i18n.c (i18n_init) [USE_SIMPLE_GETTEXT]: Call textdomain. - -2010-10-14 Werner Koch - - * asshelp.c (start_new_gpg_agent): Print a notice once the agent - has been started. - (start_new_dirmngr): Likewise. - -2010-10-13 Werner Koch - - * miscellaneous.c (parse_version_number, parse_version_string) - (gnupg_compare_version): New. - -2010-10-04 Werner Koch - - * gettime.c (asctimestamp) [W32CE]: Do not print the timezone. - -2010-09-30 Werner Koch - - * util.h (GPG_ERR_FULLY_CANCELED): Add replacement. - -2010-09-17 Werner Koch - - * http.c (INADDR_NONE): Provide fallback. - * logging.c (INADDR_NONE): Ditto. - -2010-09-16 Werner Koch - - * util.h: Add GPG_ERR_MISSING_ISSUER_CERT. - * status.c (get_inv_recpsgnr_code): Ditto. - -2010-09-13 Werner Koch - - * homedir.c (gnupg_bindir) [W32CE]: Change to bin/. - (gnupg_libexecdir) [W32]: Call gnupg_bindir. - (gnupg_libdir, gnupg_datadir, gnupg_localedir) [W32]: Simplify by - using xstrconcat. - (gnupg_module_name): Ditto. - (w32_rootdir): Strip a trailing "bin". - -2010-09-02 Werner Koch - - * util.h (GPG_ERR_NOT_INITIALIZED): Define if not defined. - -2010-09-01 Marcus Brinkmann - - * estream.c (_es_set_std_fd): Disable debug output. - -2010-08-26 Werner Koch - - * estream.c (es_convert_mode): Rename to parse_mode. - (parse_mode): Add arg R_CMODE and parse key value pairs. Use Use - 664 as the default mode. Change callers. - (ES_DEFAULT_OPEN_MODE): Remove. - (es_fopen, do_fpopen, do_w32open, es_freopen): Support a creation - mode. - (es_func_file_create): Rename to func_file_create and add arg CMODE. - (es_func_fd_create): Rename to func_fd_create. - (es_func_fp_create): Rename to func_fp_create. - (es_list_add): Rename to do_list_add. - (es_list_remove): Rename to do_list_remove. - (es_list_iterate): Rename to do_list_iterate. - (es_pth_read): Rename to do_pth_read. - (es_deinit): Rename to do_deinit. - (es_init_do): Rename to do_init. - (es_func_mem_create): Rename to func_mem_create. - -2010-08-23 Werner Koch - - * exechelp-w32ce.c: Rewrite all spawn stuff. - - * exechelp-w32.c (close_all_fds) [W32]: Make it a dummy function. - - * estream.c (es_onclose): New. - (notify_list_t, onclose): New. - (struct estream_internal): Add field ONCLOSE. - (es_initialize, es_deinitialize): Manage new field. - (do_close): Call onclose notify functions. - -2010-08-20 Werner Koch - - * exechelp-w32.c (create_inheritable_pipe): Change arg to HANDLE. - - * estream.h (es_sysopen_t): New. - * estream.c (es_func_w32_create, es_func_w32_read) - (es_func_w32_write, es_func_w32_seek, es_func_w32_destroy) - (estream_functions_w32, estream_cookie_fd): New. Only for W32. - (es_sysopen, es_sysopen_nc): New. - (do_w32open, do_sysopen): New. - (es_syshd, es_syshd_unlocked): New. - (struct estream_internal): Replace filed FD by SYSHD. - (es_initialize): Clear SYSHD_VALID. - (map_w32_to_errno): New. - (es_get_fd): Remove. - (es_fileno_unlocked): Re-implement using es_syshd. - (es_initialize, es_create): Replace arg FD by SYSHD. - (es_fopen, es_mopen, es_fopenmem, do_fdopen, do_fpopen) - (es_tmpfile): Use SYSHD instead of FD. - (es_destroy): Rename to do_close. - -2010-08-19 Werner Koch - - * exechelp-posix.c (create_pipe_and_estream): New. - (gnupg_spawn_process): Rework this function and its calling - convention; it is not used anyway. - * exechelp-w32.c (gnupg_spawn_process): Ditto. - -2010-08-18 Werner Koch - - * logging.c (writen): Add arg IS_SOCKET. - (fun_writer): Pass the is_socket flag. - (do_logv) [W32]: Allow for a default log stream - - * estream.c (struct estream_internal): Remove obsolete fields - PRINT_FP, PRINT_ERRNO, PRINT_ERR and all remaining code cruft. - -2010-08-16 Werner Koch - - * estream.c (es_printf_unlocked, es_printf): New. - - * asshelp.c (lock_agent_t): Rename to lock_spawn_t. - (lock_agent_spawning, unlock_agent_spawning): Factor code out to ... - (lock_spawning, unlock_spawning): .. new. - (start_new_gpg_agent): Make more use of ERRSOURCE. - (start_new_dirmngr): New. - -2010-08-13 Werner Koch - - * Makefile.am (audit-events.h, status-codes.h): Fix srcdir problem - amd depend on Makefile.am instead of Makefile. - -2010-08-12 Werner Koch - - * sysutils.c (gnupg_remove) [W32CE]: Fix returned error. - -2010-08-09 Werner Koch - - * logging.c (WITH_IPV6): New macro. - (parse_portno): New. From libassuan. - (fun_writer): Support TCP logging on all platforms. - (sock_close): New. - -2010-08-06 Werner Koch - - * homedir.c (dirmngr_socket_name) [W32CE]: Base on default homedir. - (gnupg_cachedir) [W32CE]: Drop drive letter. - - * http.c (http_open_document): Rename to _http_open_document and - add arg ERRSOURCE. Pass ERRSOURCE to all called funcs. - (http_wait_response, http_open, http_parse_uri): Likewise. - (do_parse_uri, parse_response, store_header): Change to return an - gpg_err_code_t. Change callers. - (send_request): Add arg ERRSOURCE. Change callers. - * http.h (http_open_document, http_wait_response, http_open) - (http_parse_uri): Define as macro. - -2010-08-05 Werner Koch - - * estream.h (es_asprintf, es_vasprintf): Add lost prototyps. - - * http.c: Require estream and make HTTP_USE_ESTREAM obsolete. It - make the code unreadable and we require estream anyway for GnuPG. - (http_wait_response): Get use of cookies right. - (send_request): s/xtryasprintf/es_asprintf/ to allow standalone - use of the code. - (insert_escapes, connect_server): s/sprintf/snprintf/. - (parse_response): s/my_read_line/es_read_line/. - (my_read_line): Remove. - (write_server): Use pth_write. - -2010-07-26 Werner Koch - - * estream.c (es_func_fp_write) [W32]: Write smaller chunks. - -2010-07-25 Werner Koch - - * argparse.c (initialize): Use ARGPARSE_PRINT_WARNING constant. - -2010-07-24 Werner Koch - - * estream.c (es_set_binary): New. - -2010-07-19 Werner Koch - - * utf8conv.c (utf8_to_wchar): s/malloc/jnlib_malloc/. - -2010-07-16 Werner Koch - - * http.h (HTTP_FLAG_IGNORE_CL): Add flag . - * http.c (WITHOUT_GNU_PTH): Test macro for Pth support. - (http_parse_uri): s/xcalloc/xtrycalloc/. - (send_request): Replace of discrete allocation and sprintf by - xtryasprintf. - (http_wait_response): Replace HTTP_FLAG_NO_SHUTDOWN by - HTTP_FLAG_SHUTDOWN to change the default to no shutdown. - (cookie_read) [HAVE_PTH]: Use pth_read. - (longcounter_t): New. - (struct cookie_s): Add support for content length. Turn flag - fields into bit types. - (parse_response): Parse content length header. - (cookie_read): Take care of the content length. - -2010-07-08 Werner Koch - - * estream.c (estream_functions_file): Remove and replace by - identical estream_functions_fd. - -2010-07-06 Werner Koch - - * util.h (b64state): Add field STREAM. - * b64enc.c (b64enc_start): Factor code out to .. - (enc_start): new. - (b64enc_start_es, my_fputs): New. - (b64enc_write, b64enc_finish): Support estream. - -2010-06-24 Werner Koch - - * asshelp.c (lock_agent_spawning) [W32]: Use CreateMutexW. - (start_new_gpg_agent): Use HANG option for gnupg_wait_progress. - Fixes regression from 2010-06-09. - -2010-06-21 Werner Koch - - * util.h (xfree_fnc): New. - -2010-06-18 Werner Koch - - * util.h (GPG_ERR_MISSING_KEY) [!GPG_ERR_MISSING_KEY]: New. - - * sexputil.c (make_canon_sexp_pad): Add arg SECURE. - -2010-06-17 Werner Koch - - * sexputil.c (make_canon_sexp_pad): New. - -2010-06-14 Werner Koch - - * membuf.c (put_membuf): Add shortcut for !LEN. - -2010-06-11 Marcus Brinkmann - - * sysutils.c (translate_sys2libc_fd): Revert last change. - (translate_sys2libc_fd_int): Revert last change. - -2010-06-10 Marcus Brinkmann - - * sysutils.c (translate_sys2libc_fd) [HAVE_W32CE_SYSTEM]: - Implement. - (translate_sys2libc_fd_int) [HAVE_W32CE_SYSTEM]: Don't call - translate_sys2libc_fd. - - * estream.c (_es_get_std_stream): Fix cut&paste bug. - -2010-06-09 Werner Koch - - * exechelp-posix.c, exechelp-w32.c - * exechelp-w32ce.c (gnupg_wait_process): Add new arg HANG. Change - all callers. - (gnupg_release_process): New. Use it after all calls to - gnupg_wait_process. - - * util.h (GNUPG_MODULE_NAME_DIRMNGR_LDAP): New. - * homedir.c (gnupg_cachedir): New. - (w32_try_mkdir): New. - (dirmngr_socket_name): Change standard socket name. - (gnupg_module_name): Support GNUPG_MODULE_NAME_DIRMNGR_LDAP. - - * logging.c (log_set_get_tid_callback): Replace by ... - (log_set_pid_suffix_cb): .. new. - (do_logv): Change accordingly. - -2010-06-08 Marcus Brinkmann - - * Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS). - (t_common_ldadd): Add $(LIBASSUAN_LIBS). - * sysutils.c: Include . - (translate_sys2libc_fd_int): Cast to silence gcc warning. - * iobuf.c: Include - (translate_file_handle): Fix syntax error. - -2010-06-08 Werner Koch - - * iobuf.c (translate_file_handle) [W32CE]: Handle rendezvous ids. - -2010-06-07 Werner Koch - - * sysutils.c [W32CE]: Finish pipe creation. - - * estream.c (es_fname_get, es_fname_set): New. - (fname_set_internal): New. - (struct estream_internal): Add fields printable_fname and - printable_fname_inuse. - (_es_get_std_stream): Set stream name. - (es_fopen, es_freopen, es_deinitialize): Set fname. - - * exechelp-posix.c (gnupg_spawn_process): Allow passing INFILE or - OUTFILE as NULL. - * exechelp-w32.c (gnupg_spawn_process): Ditto. - * exechelp-w32ce.c (gnupg_spawn_process): Return an error for - INFILE or OUTFILE passed as NULL. - -2010-06-01 Werner Koch - - * logging.c (log_get_stream): Make sture a log stream is available. - -2010-05-30 Werner Koch - - * init.c (writestring_via_estream): New. - (init_common_subsystems): Register with argparse. - - * argparse.c (argparse_register_outfnc): New. - (writestrings, flushstrings): New. Use them instead of stdout or - stderr based functions. - -2010-05-04 Werner Koch - - * estream.c (_es_get_std_stream): Re-use registered standard fds. - (IS_INVALID_FD, ESTREAM_SYS_YIELD): New. - (es_func_fd_read, es_func_fd_write, es_func_fd_seek) - (es_func_fd_destroy): Implement a dummy stream. - - * exechelp-w32ce.c (build_w32_commandline): Add args FD0_ISNULL - and FD1_ISNULL. Remove arg PGMNAME. Change callers. - (gnupg_spawn_process_detached): Implement. - (gnupg_spawn_process_fd): Implement one special case for now. - -2010-05-03 Werner Koch - - * asshelp.c (lock_agent_spawning, unlock_agent_spawning): New. - (start_new_gpg_agent): Test for configured standard socket and - try to fire up the agent in this case. - - * exechelp-posix.c (gnupg_wait_process): Do not log a message if - EXITCODE is given. - (gnupg_spawn_process_detached): Do not reuse PID for the second fork. - -2010-04-26 Werner Koch - - * utf8conv.c (load_libiconv) [W32CE]: No libiconv warning - - * init.c (init_common_subsystems) [W32CE]: Register the sleep - function before es_init. - -2010-04-20 Werner Koch - - * estream.c (es_deinit): New. - (es_init_do): Install atexit handler to flush all streams. - - * Makefile.am (common_sources): Add gettime.h. - -2010-04-20 Marcus Brinkmann - - * logging.c (do_log_ignore_arg): New helper function. - (log_string): Use it to remove ugly volatile hack that causes gcc - warning. - (log_flush): Likewise. - * sysutils.c (gnupg_unsetenv) [!HAVE_W32CE_SYSTEM]: Return something. - (gnupg_setenv) [!HAVE_W32CE_SYSTEM]: Likewise. - * pka.c (get_pka_info): Solve strict aliasing rule violation. - * t-exechelp.c (test_close_all_fds): Use dummy variables to - silence gcc warning. - -2010-04-15 Werner Koch - - * util.h: Factor time related functions out to ... - * gettime.h: New. - (gnupg_copy_time): Move to ... - * gettime.c (gnupg_copy_time): New. - - * sysutils.c (gnupg_setenv) [!W32CE]: Add missing return. - (gnupg_unsetenv) [!W32CE]: Add missing return. - -2010-04-14 Werner Koch - - * Makefile.am (noinst_LIBRARIES) [W32CE]: Exclude libsimple-pwquery. - - * w32help.h (umask) [W32CE]: New. - - * sysutils.c (_gnupg_isatty): New. - * util.h (gnupg_isatty): New. - - * asshelp.c (setup_libassuan_logging): Read ASSUAN_DEBUG envvar. - (my_libassuan_log_handler): Use it. - * sysutils.c (_gnupg_getenv): Implement ASSUAN_DEBUG. - -2010-04-08 Werner Koch - - * w32help.h (_setmode, setmode) [W32CE]: Provide prototype and - macro. - -2010-04-07 Werner Koch - - * mischelp.c (timegm): Replace unsetenv/putenv by gnupg_unsetenv. - - * sysutils.c: Include setenv.h. - (gnupg_setenv, gnupg_unsetenv): New. - - -2010-04-06 Werner Koch - - * sysutils.c (gnupg_mkdir): New. - -2010-03-29 Werner Koch - - * init.c (sleep_on_exit): Change to 400ms. - -2010-03-25 Werner Koch - - * init.c (sleep_on_exit) [W32CE]: New. - (init_common_subsystems): Call it. - -2010-03-24 Werner Koch - - * stringhelp.c (change_slashes, compare_filenames): Replace - HAVE_DRIVE_LETTERS by HAVE_DOSISH_SYSTEM. - (make_basename, make_dirname): Detect backslashes and drive - letters separately. - - * dotlock.c (make_dotlock, create_dotlock, release_dotlock): Use - LockFileEx and UnlockFileEx to support W32CE. - - * ttyio.c (USE_W32_CONSOLE): Replace all _WIN32 by this. - (init_ttyfp) [W32CE]: Use stderr. - - * iobuf.c (FD_FOR_STDIN, FD_FOR_STDOUT) [W32CE]: Use estream. - (translate_file_handle) [W32CE]: Remove handle translation. - -2010-03-23 Werner Koch - - * sysutils.c (gnupg_remove): New. - -2010-03-22 Werner Koch - - * exechelp-w32ce.c (build_w32_commandline): Replace by code from - libassuan. - (create_inheritable_pipe): Use _assuan_w32ce_prepare_pipe. - (build_w32_commandline_copy, do_create_pipe): Remove. - - * exechelp-posix.c (gnupg_spawn_process): Change to use estream - also for INFILE and STATUSFILE. - * exechelp-w32.c (gnupg_spawn_process): Ditto. - -2010-03-22 Werner Koch - - * exechelp.c: Remove after factoring all code out to ... - * exechelp-posix.c, exechelp-w32.c, exechelp-w32ce.c: .. new. - - * exechelp.c (create_inheritable_pipe_r) - (create_inheritable_pipe_w): Fold both into ... - (create_inheritable_pipe): .. New. Change callers to use this. - (gnupg_create_inbound_pipe, gnupg_create_outbound_pipe): Factor - code out to ... - (do_create_pipe): .. New. - - * init.c (parse_std_file_handles): Change to use rendezvous ids. - -2010-03-15 Werner Koch - - * init.c (init_common_subsystems): Add args ARGCP and - ARGVP. Change all callers to provide them. - (parse_std_file_handles): New. - - * t-sysutils.c (rewind) [W32CE]: Provide a replacement. - - * Makefile.am (module_tests) [W32CE]: Don't build t-exechelp for now. - - * sysutils.c (gnupg_allow_set_foregound_window) [W32CE]: Don't - call AllowSetForegroundWindow. - - * logging.c (isatty) [W32CE]: New. - (fun_writer, set_file_fd): Use estream even for the internal error - messages. - (log_string, log_flush): Make DUMMY_ARG_PTR static. - -2010-03-15 Werner Koch - - * asshelp.c (send_pinentry_environment) [!HAVE_SETLOCALE]: Do not - define OLD_LC. - * http.c (connect_server) [!USE_DNS_SRV]: Mark SRVTAG unused. - * dns-cert.c (get_dns_cert) [!USE_DNS_CERT]: Mark args unused. - * pka.c (get_pka_info): Ditto. - - * signal.c (pause_on_sigusr): Remove. It was used in ancient gpg - version with shared memory IPC. Last caller removed on 2006-04-18. - (do_block) [W32]: Mark arg unused. - - * exechelp.c (w32_open_null): Use CreateFileW. - - * init.c (init_common_subsystems): Add args ARGCP and ARGVP. - Change all callers to pass them. - - * logging.c (S_IRGRP, S_IROTH, S_IWGRP, S_IWOTH) [W32]: New. - (fun_writer, set_file_fd) [W32]: Disable socket code. - - * localename.c: Include gpg-error.h. - - * util.h (GPG_ERR_NOT_ENABLED): Remove this temporary definition. - -2010-03-12 Werner Koch - - * status.h (STATUS_ENTER): New. - - * ttyio.c (tty_fprintf): Change to use estream. - - * miscellaneous.c (print_utf8_string): Rename to print_utf8_buffer - and change FP arg to an estream. Change all callers. - (print_utf8_string2): Ditto; new name is to print_utf8_buffer2. - -2010-03-11 Werner Koch - - * miscellaneous.c (print_string): Remove. - - * estream.c (es_setvbuf): Fix parameter check. - (es_set_buffering): Allow a SIZE of 0. - * asshelp.c (setup_libassuan_logging, my_libassuan_log_handler): New. - * logging.c (do_logv): Add arg IGNORE_ARG_PTR. Change all callers. - (log_string): New. - (log_flush): New. - (set_file_fd): Simplify by using estreams es_stderr. - - * estream.h (es_stdout, es_stderr, es_stdin): New. - -2010-03-10 Werner Koch - - * estream.c (es_func_fp_read, es_func_fp_write, es_func_fp_seek) - (es_func_fp_destroy): Allow a NULL FP to implement a dummy stream. - (do_fpopen): Ditto. - (es_vfprintf_unlocked): New. - (es_fprintf_unlocked): Make public. - (es_fputs_unlocked): New. - - * logging.h: Replace FILE* by estream_t. - * logging.c: Remove USE_FUNWRITER cpp conditional because we now - use estream. - (my_funopen_hook_ret_t, my_funopen_hook_size_t): Replace by - ssize_t. - (log_get_stream): Change to return an estream_t. - (set_file_fd): Always close the log stream because it can't be - assigned to stderr or stdout directly. Use a dummy estream as - last resort log stream. - (log_test_fd, log_get_fd): Use es_fileno. - (log_get_stream): Assert that we have a log stream. - (do_logv): Use estream functions and lock the output. - -2010-03-10 Werner Koch - - * util.h: Replace jnlib path part by common. - (snprintf): Use the replacement macro on all platforms. - - * Makefile.am (jnlib_sources): New. - (libcommon_a_SOURCES, libcommonpth_a_SOURCES): Add jnlib_sources. - (jnlib_tests): New. - (noinst_PROGRAMS, TESTS): Add jnlib_tests. - (t_common_ldadd): Remove libjnlib.a. - - * README.jnlib, ChangeLog.jnlib, libjnlib-config.h, argparse.c - * argparse.h, dotlock.c, dotlock.h, dynload.h, logging.c - * logging.h, mischelp.c, mischelp.h, stringhelp.c, stringhelp.h - * strlist.c, strlist.h, types.h, utf8conv.c, utf8conv.h - * w32-afunix.c, w32-afunix.h, w32-reg.c, w32help.h, xmalloc.c - * xmalloc.h, t-stringhelp.c, t-support.c, t-support.h - * t-timestuff.c, t-w32-reg.c: Move from jnlib to here. - - * init.c: Remove "estream.h". - * util.h: Include "estream.h". - - * xasprintf.c, ttyio.c: Remove "estream-printf.h". - -2010-03-08 Werner Koch - - * exechelp.c [!HAVE_SIGNAL_H]: Do not include signal.h. - (DETACHED_PROCESS, CREATE_NEW_PROCESS_GROUP) [W32CE]: Provide stubs. - - * iobuf.h (iobuf_ioctl_t): New. Use the new macros instead of the - hard wired values. - * iobuf.c (iobuf_append): Remove. - (iobuf_fdopen): Factor code out to ... - (do_iobuf_fdopen): ... new. - (iobuf_fdopen_nc): New. - (iobuf_open_fd_or_name): Implement using iobuf_fdopen_nc. - - * iobuf.c (INVALID_FD): Replace by GNUPG_INVALID_FD. - (fp_or_fd_t): Replace by gnupg_fd_t. - (my_fileno): Replace by the FD2INT macro. - (FILEP_OR_FD_FOR_STDIN, FILEP_OR_FD_FOR_STDOUT): Rename to - FD_FOR_STDIN, FD_FOR_STDOUT. - (file_filter): Make full use of FD_FOR_STDIN. - (USE_SETMODE): Remove. Not needed without stdio. - (my_fopen_ro, my_fopen): Replace unneeded macros. - - * iobuf.c [FILE_FILTER_USES_STDIO]: Remove all code. It has not - been used for a long time. - - * exechelp.h: Include "estream.h". - - * exechelp.c (gnupg_spawn_process): Change OUTFILE to an estream_t. - -2010-03-02 Werner Koch - - * estream.c, estream.h, estream-printf.c, estream-printf.h: Update - from libestream. - -2010-03-01 Werner Koch - - * signal.c [!HAVE_SIGNAL_H]: Don't include signal.h. - - * iobuf.c (direct_open) [W32CE]: Make filename to wchar_t. - (iobuf_cancel) [W32CE]: Use DeleteFile. - - * gettime.c (dump_isotime): Use "%s" to print "none". - - * homedir.c (standard_homedir) [W32CE]: Use wchar_t to create the - directory. - (w32_rootdir) [W32CE]: Likewise. - - * sysutils.c (translate_sys2libc_fd) [W32CE]: Add support. - (gnupg_tmpfile) [W32CE]: Ditto. - (_gnupg_getenv) [W32CE]: New. - - * util.h (getpid, getenv) [W32CE]: New. - - * i18n.c (i18n_switchto_utf8) - (i18n_switchback) [USE_SIMPLE_GETTEXT]: Use new function from - libgpg-error which supports proper restoring. - - * sysutils.c (get_session_marker): Simplified by using gcrypt. - -2009-12-08 Marcus Brinkmann - - * Makefile.am (audit-events.h, status.h) [!MAINTAINER_MODE]: No - longer include these rules if not in maintainer mode. - -2009-12-08 Werner Koch - - * userids.h, userids.c: New. - (classify_user_id): Merged from similar fucntions in sm/ and g10/. - - * dns-cert.c (get_dns_cert): Add support for ADNS. - -2009-12-08 Marcus Brinkmann - - * asshelp.c (start_new_gpg_agent): Convert posix FD to assuan FD. - - * asshelp.c (start_new_gpg_agent) [HAVE_W32_SYSTEM]: Add missing - argument in assuan_socket_connect invocation. - * iobuf.c (iobuf_open_fd_or_name): Fix type of FD in function - declaration. - -2009-12-07 Werner Koch - - * pka.c (get_pka_info): Add support for ADNS. - * src.v (getsrv): Add support for ADNS. - - * srv.c (getsrv): s/xrealloc/xtryrealloc/. - -2009-12-04 Werner Koch - - * Makefile.am (audit-events.h, status-codes.h): Create files in - the source dir. Fixes bug#1164. - -2009-12-02 Werner Koch - - * audit.c (proc_type_decrypt, proc_type_sign): Implemented. - (proc_type_verify): Print hash algo infos. - * audit.h (AUDIT_DATA_CIPHER_ALGO, AUDIT_BAD_DATA_CIPHER_ALSO) - (AUDIT_NEW_RECP, AUDIT_DECRYPTION_RESULT, AUDIT_RECP_RESULT) - (AUDIT_ATTR_HASH_ALGO, AUDIT_SIGNED_BY, AUDIT_SIGNING_DONE): - -2009-11-05 Marcus Brinkmann - - * asshelp.c (start_new_gpg_agent): Update use of - assuan_socket_connect and assuan_pipe_connect. - -2009-11-02 Marcus Brinkmann - - * get-passphrase.c (default_inq_cb, membuf_data_cb): Change return - type to gpg_error_t. - -2009-10-28 Werner Koch - - * status.h (STATUS_MOUNTPOINT): New. - -2009-10-16 Marcus Brinkmann - - * Makefile.am (libcommon_a_CFLAGS): Use LIBASSUAN_CFLAGS instead - of LIBASSUAN_PTH_CFLAGS. - -2009-10-13 Werner Koch - - * exechelp.c (gnupg_kill_process): New. - -2009-09-29 Werner Koch - - * exechelp.c (create_inheritable_pipe): Rename to - create_inheritable_pipe_w. - (create_inheritable_pipe_r): New. - (gnupg_create_outbound_pipe): New. - - * iobuf.h: Include "sysutils.h" - - * iobuf.c (iobuf_open_fd_or_name): New. - (iobuf_get_fname_nonnull): New. - -2009-09-23 Marcus Brinkmann - - * asshelp.c (start_new_gpg_agent): Allocate assuan context before - starting server. - -2009-09-03 Werner Koch - - Update from libestream: - * estream-printf.c: Include stdint.h only if HAVE_STDINT_H is - defined. - * estream-printf.c: Remove all test code. Use macro DEBUG instead - of TEST for debugging. - * estream-printf.c (pr_float): Make buffer larger for silly high - numbers. - -2009-08-11 David Shaw - - * ttyio.h, ttyio.c (tty_enable_completion): Some ifdefs around - HAVE_LIBREADLINE to allow building when readline isn't available. - -2009-08-06 Werner Koch - - * status.h (STATUS_INV_SGNR, STATUS_NO_SGNR): New. - * status.c (get_inv_recpsgnr_code): New. - -2009-07-23 David Shaw - - * srv.c (getsrv): Fix type-punning warning. - -2009-07-23 Werner Koch - - * util.h (GPG_ERR_NOT_ENABLED): New. - * audit.h (enum): Add AUDIT_CRL_CHECK. - * audit.c (proc_type_verify): Show CRL check result. - -2009-07-06 Werner Koch - - * get-passphrase.c (struct agentargs): Add SESSION_ENV and remove - obsolete args. - (gnupg_prepare_get_passphrase): Ditto. - - * session-env.c, session-env.h: New. - * t-session-env.c: New. - * Makefile.am (common_sources, module_tests): Add them. - * asshelp.h: Include "session-env.h" - * asshelp.c (send_one_option): Add arg PUTENV. - (send_pinentry_environment): Replace most args by SESSION_ENV and - rewrite fucntion. - (start_new_gpg_agent): Likewise. - - * t-exechelp.c (test_close_all_fds): Remove debug code. - -2009-07-01 Werner Koch - - * sexputil.c (get_pk_algo_from_canon_sexp): New. - -2009-06-29 Werner Koch - - * estream.c (BUFFER_ROUND_TO_BLOCK): Remove unused macro. - (es_func_mem_write): Rewrite reallocation part. - - * estream.c (es_write_sanitized_utf8_buffer): Typo typo fix. - -2009-06-25 Werner Koch - - * estream.c (es_write_sanitized_utf8_buffer): Typo fix. - -2009-06-24 Werner Koch - - * estream.c (es_read_line): In the malloc error case, set - MAX_LENGTH to 0 only if requested. - * xreadline.c (read_line): Ditto. - * estream.c (es_write_sanitized_utf8_buffer): Pass on error from - es_fputs. - * sexputil.c (get_rsa_pk_from_canon_sexp): Check for error after - the loop. Reported by Fabian Keil. - -2009-06-22 Werner Koch - - * estream.c (es_pth_read, es_pth_write) [W32]: New. - (ESTREAM_SYS_READ, ESTREAM_SYS_WRITE) [HAVE_PTH]: Use them. - -2009-06-03 Werner Koch - - * estream.c (es_convert_mode): Rewrite and support the "x" flag. - -2009-05-28 David Shaw - - From 1.4: - - * http.h, http.c (send_request) Pass in a STRLIST for additional - headers. Change all callers. - -2009-05-27 David Shaw - - From 1.4: - - * http.h, http.c (send_request): Pass in srvtag and make its - presence sufficient to turn the feature on. - (http_open): From here. - (http_document): And here. - - * srv.c (getsrv): Raise maximum packet size to 2048, as PACKETSZ - is too small these days. - -2009-05-22 Werner Koch - - * ttyio.c (tty_cleanup_after_signal): New. - -2009-05-19 Werner Koch - - * simple-pwquery.c (agent_open): Use SUN_LEN - (JNLIB_NEED_AFLOCAL): Define and include mischelp.h. - -2009-05-07 Werner Koch - - * sexputil.c (get_rsa_pk_from_canon_sexp): New. - * t-sexputil.c (test_make_canon_sexp_from_rsa_pk): Extend the test. - -2009-04-28 Werner Koch - - * sexputil.c (make_canon_sexp_from_rsa_pk): New. - * t-sexputil.c (test_make_canon_sexp_from_rsa_pk): New. - -2009-04-01 Werner Koch - - * iobuf.c: Port David's changes from 1.4: - (fd_cache_invalidate): Pass return code from close back. - (direct_open, iobuf_ioctl): Check that return value. - (fd_cache_synchronize): New. - (iobuf_ioctl): Add new sub command 4 (fsync). - - * iobuf.c (fd_cache_strcmp): New. Taken from 1.4. - (fd_cache_invalidate, fd_cache_close, fd_cache_open): Use it. - - * exechelp.c (gnupg_spawn_process): Implement new flag bit 6. - * sysutils.c (gnupg_allow_set_foregound_window): Allow the use of - ASFW_ANY. - - * membuf.c (put_membuf, get_membuf): Wipe memory on out of core. - -2009-03-31 Werner Koch - - * percent.c (percent_unescape, percent_plus_unescape): New. - (percent_plus_unescape_inplace, percent_unescape_inplace): New. - (do_plus_or_plain_unescape, count_unescape, do_unescape): New. - (do_unescape_inplace): New. - * t-percent.c (test_percent_plus_escape): Test percent_plus_unescape. - - * get-passphrase.c, get-passphrase.h: New. - * Makefile.am (without_pth_sources): New. - -2009-03-18 Werner Koch - - * exechelp.c: Include sys/resource.h and sys/stat.h. - (get_max_open_fds): New. - (do_exec): Use it. - (get_all_open_fds): New. - (close_all_fds): New. - (do_exec): Use close_all_fds. - * t-exechelp.c: New. - -2009-03-13 David Shaw - - * http.c (do_parse_uri): Properly handle IPv6 literal addresses as - per RFC-2732. Adapted from patch by Phil Pennock. - -2009-03-12 Werner Koch - - * gettime.c: Include i18n.h. - (dump_isotime): New. - -2009-03-06 Werner Koch - - * sexputil.c (make_canon_sexp): New. - -2009-03-03 Werner Koch - - * exechelp.c (do_exec): Make sure that /dev/null connected FDs are - not closed. - -2009-01-19 Werner Koch - - * audit.c (writeout_li): Translate a few more result strings. - Fixes bug#970. - - * convert.c (hex2str): Fix optimization to append a nul character. - -2008-12-05 Werner Koch - - * percent.c, t-percent.c: New. - - * exechelp.c (gnupg_spawn_process, gnupg_spawn_process_fd) - (gnupg_spawn_process_detached) [W32]: Remove debug output. - -2008-11-20 Werner Koch - - * audit.c (writeout_li): Translate OKTEXT. - -2008-11-04 Werner Koch - - * i18n.c (i18n_init) [USE_SIMPLE_GETTEXT]: Adjust for changed - w32-gettext.c. - * homedir.c (gnupg_localedir): New. - -2008-10-20 Werner Koch - - * http.c (http_register_tls_callback) [!HTTP_USE_GNUTLS]: Mark - unused arg. - * localename.c (do_nl_locale_name): Ditto. - * audit.c (event2str): Silent gcc warning. - * sysutils.c (translate_sys2libc_fd): Mark unused arg. - (translate_sys2libc_fd_int): Ditto. - * iobuf.c (translate_file_handle): Ditto. - * asshelp.c (send_one_option): Ditto. - * exechelp.c (gnupg_spawn_process): Ditto. - * signal.c (got_usr_signal): Ditto - * estream.c (es_func_fd_create) [!W32]: Ditto. - (es_func_fp_create) [!W32]: Ditto. - (es_write_hexstring): Ditto. - (dummy_mutex_call_void, dummy_mutex_call_int) [HAVE_PTH]: New. - (ESTREAM_MUTEX_LOCK, ESTREAM_MUTEX_UNLOCK, ESTREAM_MUTEX_TRYLOCK) - (ESTREAM_MUTEX_INITIALIZE) [HAVE_PTH]: Use dummy calls so to mark - unused arg. - -2008-10-19 Werner Koch - - * estream-printf.c (estream_vsnprintf): Fix return value. - (check_snprintf): Add a new test. - (one_test) [W32]: Disable test. - -2008-10-17 Werner Koch - - * util.h (snprintf) [W32]: Redefine to estream_snprintf. - -2008-09-03 Werner Koch - - * convert.c (hex2str): New. - (hex2str_alloc): New. - * t-convert.c (test_hex2str): New. - -2008-08-19 Werner Koch - - * iobuf.c: Avoid passing a NULL (iobuf_t)->desc to the log - function. Should in general never be NULL, but well. Reported by - M. Heneka. - -2008-06-26 Werner Koch - - * estream.c (es_write_sanitized): Loose check for control - characters to better cope with utf-8. The range 0x80..0x9f is - nowadays not anymore accidently used for control charaters. - -2008-06-25 Marcus Brinkmann - - Revert last three changes related to handle translation. - * sysutils.c: - (FD_TRANSLATE_MAX, fd_translate, fd_translate_len) - (translate_table_init, translate_table_lookup): Removed. - * iobuf.c (check_special_filename): Do not use - translate_table_lookup. - * sysutils.h (translate_table_init, translate_table_lookup): - Remove prototypes. - -2008-06-19 Werner Koch - - * sysutils.c: Remove . - (fd_translate_max): Use macro for the size. - (translate_table_init): Protect read against EINTR and replace - isspace by spacep. - -2008-06-18 Marcus Brinkmann - - * sysutils.c (TRANS_MAX): Bump up to 350 to be on the safe side. - - * sysutils.h (translate_table_init, translate_table_lookup): New - prototypes. - * sysutils.c: Include . - (FD_TRANSLATE_MAX): New macro. - (fd_translate, fd_translate_len): New static variables. - (translate_table_init, translate_table_lookup): New functions. - (translate_sys2libc_fd_int): Translate file descriptor. - * iobuf.c (check_special_filename): Translate handle values from - special filenames. - -2008-06-16 Werner Koch - - * homedir.c (w32_commondir): New. - (gnupg_sysconfdir): Use it. - -2008-06-09 Werner Koch - - * b64dec.c: New. - -2008-06-05 Werner Koch - - * util.h (gnupg_copy_time): Replace strcpy by memcpy. - -2008-05-26 Werner Koch - - * asshelp.c (send_one_option, send_pinentry_environment): use - xfree and xtrystrdup. - - * i18n.c (i18n_switchto_utf8) [USE_SIMPLE_GETTEXT]: Return NULL. - - * homedir.c (gnupg_module_name): Add - GNUPG_MODULE_NAME_CONNECT_AGENT and GNUPG_MODULE_NAME_GPGCONF. - -2008-04-21 Werner Koch - - * http.c (http_wait_response) [W32]: Use DuplicateHandle because - it is a socket. - (cookie_read) [W32]: Use recv in place of read. - -2008-04-08 Werner Koch - - * i18n.c (i18n_switchto_utf8, i18n_switchback) - [USE_SIMPLE_GETTEXT]: Implement. - -2008-04-07 Werner Koch - - * b64enc.c (b64enc_start): Detect PGP mode. - (b64enc_finish): Write PGP CRC. - * util.h (struct b64state): Add field CRC. - * t-b64.c: New. - - * pka.c (get_pka_info): Use xtrymalloc and check result. - -2008-03-25 Werner Koch - - * localename.c: Strip all W32 code. Include w32help.h. - (gnupg_messages_locale_name) [W32]: Use the gettext_localename. - -2008-03-17 Werner Koch - - * iobuf.c (IOBUF_BUFFER_SIZE): Actually use this macro. - - * simple-pwquery.c (agent_send_all_options): Fix last change. - -2008-03-06 Werner Koch - - * simple-pwquery.c (agent_send_all_options): Add support for - XAUTHORITY and PINENTRY_USER_DATA. - -2008-02-15 Marcus Brinkmann - - * exechelp.c (gnupg_spawn_process_fd): Add flag DETACHED_PROCESS - unconditionally (required for all callers at the moment). - -2008-02-14 Werner Koch - - * sysutils.c (gnupg_allow_set_foregound_window): New. - (WINVER) [W32]: Define. - -2008-01-31 Werner Koch - - * audit.c (audit_print_result): Make sure that the output is - always UTF8. - -2008-01-27 Werner Koch - - * exechelp.c (gnupg_spawn_process): Add arg FLAGS and changed all - callers to pass 0 for it. - -2007-12-13 Werner Koch - - * sexputil.c (hash_algo_from_sigval): New. - * t-sexputil.c: New. - * Makefile.am (module_tests): Add it. - -2007-12-11 Werner Koch - - * asshelp.c (send_pinentry_environment): Allow using of old - gpg-agents not capabale of the xauthority and pinentry_user_data - options. - -2007-12-04 Werner Koch - - * Makefile.am (t_helpfile_LDADD, module_maint_tests): New. - * t-helpfile.c: New. - * helpfile.c: New. - * membuf.h (is_membuf_ready, MEMBUF_ZERO): New. - * localename.c: New. Taken from gettext with modifications as done - for GpgOL. Export one new function. - * util.h (gnupg_messages_locale_name, gnupg_get_help_string): Added. - - * sysutils.c (gnupg_reopen_std): New. Taken from ../g10/gpg.c. - -2007-11-27 Werner Koch - - * Makefile.am (CLEANFILES): New. - - * homedir.c (dirmngr_socket_name): Use CSIDL_WINDOWS. - -2007-11-15 Werner Koch - - * asshelp.c (send_pinentry_environment): Add args XAUTHORITY and - PINENTRY_USER_DATA. - (start_new_gpg_agent): Ditto. - -2007-11-07 Werner Koch - - * status.h: New. - * errors.h: Remove. - -2007-11-05 Werner Koch - - * audit.c, audit.h: New. - * Makefile.am: Add rules to build audit-events.h. - * exaudit.awk: New. - * mkstrtable.awk: New. Taken from libgpg-error. - -2007-10-19 Werner Koch - - * i18n.c (i18n_switchto_utf8, i18n_switchback): New. - -2007-10-01 Werner Koch - - * sysutils.h (FD2INT, INT2FD): New. - -2007-09-21 Werner Koch - - * homedir.c (default_homedir): Make registry work. Reported by - Marc Mutz. - -2007-08-29 Werner Koch - - * exechelp.c (gnupg_wait_process): Add arg EXITCODE. Changed all - callers. - (gnupg_create_inbound_pipe): New. - * util.h (GNUPG_MODULE_NAME_GPGSM, GNUPG_MODULE_NAME_GPG): New. - * homedir.c (gnupg_module_name): Add them - -2007-08-28 Werner Koch - - * gettime.c (check_isotime, add_isotime): New. Originally written - for DirMngr by me. - (add_days_to_isotime): New. - (date2jd, jd2date, days_per_month, days_per_year): New. Taken from - my ancient (1988) code used in Wedit (time2.c). - -2007-08-27 Werner Koch - - * util.h (GNUPG_MODULE_NAME_CHECK_PATTERN): New. - * homedir.c (gnupg_module_name): Add it. - * exechelp.c (w32_fd_or_null) [W32]: New. - (gnupg_spawn_process_fd): New. - (gnupg_wait_process) [W32]: Close the handle after if the process has - returned. - -2007-08-22 Werner Koch - - Updated estream from libestream. - - * estream.c (mem_malloc, mem_realloc, mem_free): New. Use them - instead of the ES_MEM_foo. - * estream.c (estream_cookie_mem): Remove members DONT_FREE, - APPEND_ZERO, PTR and SIZE. Add MEMORY_LIMIT. Put GROW into a new - FLAGS struct. - (es_func_mem_create): Remove APPEND_ZERO, DONT_FREE, PTR and - SIZE. Add MEMORY_LIMIT. - (es_func_mem_write, es_func_mem_seek, es_func_mem_destroy): Revamp. - (es_open_memstream): Change API to just take a memory limit and a - mode argument. Rename to .. - (es_fopenmem): .. this. - (HAVE_W32_SYSTEM) [_WIN32]: Define if not defined. - (tmpfd) [W32]: Implement directly using the W32 API. - (es_fgets): Rewrite without using doreadline. - -2007-08-21 Werner Koch - - * sysutils.c (gnupg_tmpfile): New. - * t-sysutils.c: New. - * Makefile.am (module_tests): Add t-sysutils. - -2007-08-20 Werner Koch - - * exechelp.c [W32]: Redefine X_OK to F_OK. - -2007-08-16 Werner Koch - - * Makefile.am (t_convert_DEPENDENCIES): Remove - ($(PROGRAMS)): Remove. - (t_common_ldadd): Use libcommon.a and not the macro. - -2007-08-14 Werner Koch - - * homedir.c (dirmngr_socket_name): New. - -2007-08-07 Werner Koch - - * tlv.c, tlv.h: Move from ../scd/. - * tlv.c (parse_sexp, parse_ber_header): Add ERRSOURCE arg and prefix - name with a _. - * tlv.h: Use macro to convey ERRSOURCE. - -2007-08-02 Werner Koch - - * gc-opt-flags.h: New. - -2007-08-01 Werner Koch - - * estream-printf.c (read_dummy_value): Removed as it is useless now. - (read_values): Remove check on !vaargs which is not anymore needed - and anyway not portable. Reported by Peter O'Gorman. - -2007-07-16 Werner Koch - - * estream.c (es_func_file_create): Clear NO_CLOSE flag. - -2007-07-12 Werner Koch - - * sysutils.h (gnupg_fd_t): New. - * sysutils.c (translate_sys2libc_fd): Use that type instead of int. - (translate_sys2libc_fd_int): New. - -2007-07-09 Werner Koch - - * t-gettime.c (test_isotime2epoch): Use time_t and not u32. - -2007-07-05 Werner Koch - - * t-gettime.c: New. - * gettime.c (isotime2epoch, epoch2isotime): New. - -2007-07-04 Werner Koch - - * estream.c (es_init_do): Do not throw an error if pth has already - been initialized. - -2007-06-26 Werner Koch - - * Makefile.am ($(PROGRAMS)): New. - - * util.h (init_common_subsystems): Moved to .. - * init.h: .. New. - * util.h: Include init.h. - - * homedir.c (standard_homedir): New. - (default_homedir) [W32]: Reimplemented in terms of - standard_homedir. Fixed memory leak. - -2007-06-25 Werner Koch - - * iobuf.c: Add more documentation and slighly restructured macro - defintion for better readability. - (FILEP_OR_FD): Rename to fp_or_fd_t. - (CLOSE_CACHE): Rename to close_cache_t. - - * sysutils.c (translate_sys2libc_fd): New using the code from iobuf.c. - * iobuf.c: Include sysutils.h. - (iobuf_translate_file_handle): Remove. - (translate_file_handle): Use new function. - - * estream-printf.c [TEST]: Header including fixes. - (do_format): Do not append a trailing Nul. This avoids spurious - Nuls in the es_printf output. - (estream_vsnprintf, estream_vasprintf): Take this in account. - - * estream.h (struct es__stream): Change FLAGS to a bit structure. - (ES__FLAG_WRITING): Replace by a bit from FLAGS. * estream.c - (struct estream_internal): Rename FLAGS to MODEFLAGS so that they - are not confused with the estream flags. - (es_initialize, es_create): Add arg MODEFLAGS so that we can setup - the intial writemode. Changed all callers to pass them. - (es_convert_mode): Set O_BINARY. - (es_func_fd_create, es_func_fp_create, es_func_file_create) [W32]: - Call setmode if requested. - -2007-06-24 Werner Koch - - * estream.c (do_fpopen, es_fpopen, es_fpopen_nc): New. - (es_func_fp_create, es_func_fp_read, es_func_fp_write) - (es_func_fp_seek, es_func_fp_destroy): New. - -2007-06-22 Werner Koch - - * estream.c (es_fdopen): Factored code out to.. - (do_fdopen): .. new. - (es_fdopen_nc): New. - (estream_cookie_fd): Add field NO_CLOSE. - (es_func_fd_create): Add arg NO_CLOSE and changed all callers. - (es_func_fd_destroy): Handle the new flag. - - * homedir.c (gnupg_libexecdir) [W32]: Factor code out to .. - (w32_rootdir): .. new. - (gnupg_sysconfdir, gnupg_libdir, gnupg_datadir) [W32]: Return - name based on w32_rootdir(). - -2007-06-21 Werner Koch - - * membuf.h (get_membuf_len): New. - - * membuf.c (init_membuf_secure): Really allocate in secure memory. - (put_membuf_str): New. - - * ttyio.c (tty_getf): New. - - * util.h (ctrl_t): Declare it here. - - * asshelp.c (start_new_gpg_agent): New. Based on code from - ../sm/call-agent.c - -2007-06-20 Werner Koch - - * sysutils.c (gnupg_sleep): New. - * sysutils.h [W32]: Remove _sleep wrapper. Changed all callers to - use gnupg_sleep. - - * exechelp.c (build_w32_commandline_copy): New. - (build_w32_commandline): Factored some code out to new function - and correctly process a PGMNAME with spaces. - (gnupg_spawn_process_detached) [W32]: Implement. - -2007-06-14 Werner Koch - - * simple-pwquery.h (MAP_SPWQ_ERROR_IMPL): New. - (SPWQ_NO_PIN_ENTRY): New. - * simple-pwquery.c (simple_pw_set_socket): New. - (agent_open): Use it if GPG_AGENT_INFO is not set. - (simple_pwquery): Extended to allow returning of otehyr error codes. - - * util.h (GNUPG_MODULE_NAME_AGENT, GNUPG_MODULE_NAME_PINENTRY) - (GNUPG_MODULE_NAME_SCDAEMON, GNUPG_MODULE_NAME_DIRMNGR) - (GNUPG_MODULE_NAME_PROTECT_TOOL): New. - * homedir.c (gnupg_module_name): New. - (gnupg_bindir): New. - -2007-06-12 Werner Koch - - * homedir.c (gnupg_sysconfdir): New. - (gnupg_libexecdir): New. Taken from g10/misc.c:get_libexecdir. - (gnupg_datadir): New. - (gnupg_libdir): New. - - * http.c (connect_server) [W32]: Do not call init_sockets if - HTTP_NO_WSASTARTUP is defined. - - * init.c: New. - - * estream.c (es_init_do): Init stream lock here because we can't - use a static initialization with W32pth. - -2007-06-11 Werner Koch - - * Makefile.am (t_common_ldadd): Use libcommonstd macro. - -2007-06-06 Werner Koch - - * Makefile.am: Include am/cmacros.am. - - * sysutils.h [W32]: Remove prototypes for the registry access. - * w32reg.c: Move to ../jnlib/w32-reg.c. - - * i18n.c (i18n_init): New. - - * simple-gettext.c: Remove. - - * iobuf.c (iobuf_get_filelength): Rename SIZE to EXSIZE to silent - shadowing warning. - -2007-06-04 Werner Koch - - * http.c [W32]: Include unistd.h also in this case. - (write_server) [W32]: Fixed error code. - (init_sockets): Fixed syntax error. - (cookie_close): Replace close by sock_close macro. - - * estream.c [w32]: Do not init Mutex. - - * Makefile.am (common_sources) [USE_SNS_SRV]: Build srv.c only - when needed. - - * ttyio.c (init_ttyfp) [W32]: Do not use TTYFP. - - * util.h: Include ../jnlib/dynload.h. - - * dynload.h: Move to ../jnlib. - -2007-05-30 Werner Koch - - * estream.c (MEM_FREE, MEM_ALLOC, MEM_REALLOC): Prefix with ES_ as - windows.h also has such definitions, - -2007-05-15 Werner Koch - - * util.h: Do not include gnulib's vasprintf. Redefine asprintf - and vasprintf. - - * xasprintf.c (xasprintf, xtryasprintf): Use estream_vasprintf. - - * estream-printf.h, estream-printf.c: New. Taken from current - libestream SVN. - * Makefile.am (common_sources): Add them. - -2007-05-14 Werner Koch - - * sexp-parse.h (smklen): New. - * sexputil.c: Include sexp-parse.h. - (make_simple_sexp_from_hexstr): Replace sprintf by smklen. - -2007-05-07 Werner Koch - - * signal.c (got_fatal_signal): Protect SIG from being clobbered by - a faulty signal implementaion. Suggested by James Juran. - -2007-04-25 Werner Koch - - * i18n.h (ngettext): New. - * simple-gettext.c (ngettext): New. - -2007-04-20 Werner Koch - - * miscellaneous.c (my_gcry_logger, my_gcry_outofcore_handler): - Moved from gpg-agent to here. - (my_gcry_fatalerror_handler): new. - (setup_libgcrypt_logging): New. - -2007-03-19 Werner Koch - - * miscellaneous.c (print_hexstring): New. - * estream.c (es_fprintf_unlocked): New. - (es_write_sanitized): New. - (es_write_hexstring): New. - (es_write_sanitized_utf8_buffer) [GNUPG_MAJOR_VERSION]: New. - -2007-03-09 David Shaw - - From STABLE-BRANCH-1-4 - - * http.c (do_parse_uri): Remove the hkp port 11371 detection. We - implement hkp in the keyserver handler, and the support here makes - it appear like a bad hkp request actually succeeded. - -2007-01-31 Werner Koch - - * Makefile.am (t_common_ldadd): Add LIBINCONV and LIBINTL. - -2007-01-25 Werner Koch - - * simple-pwquery.c (simple_pwquery): New arg OPT_CHECK. - -2006-12-13 David Shaw - - * Makefile.am (AM_CPPFLAGS): Include intl/ so we can reference the - built-in headers. - -2006-11-23 Werner Koch - - * http.c: Include i18n.h - -2006-11-21 Werner Koch - - * estream.c: Remove explicit Pth soft mapping diabling becuase it - is now done in config.h. - -2006-11-15 Werner Koch - - * estream.c: Disabled Pth soft mapping. - (my_funopen_hook_ret_t): New. - (print_fun_writer): Use it here. - - * iobuf.c (fd_cache_close): Use %d instead of %p for debug output. - -2006-11-03 Werner Koch - - * Makefile.am (t_convert_DEPENDENCIES): Add libcommon. From - Gentoo. - -2006-10-24 Marcus Brinkmann - - * Makefile.am (libcommon_a_CFLAGS): Add $(LIBASSUAN_CFLAGS). - (libsimple_pwquery_a_CFLAGS): New variable. - -2006-10-20 Werner Koch - - * convert.c (hex2bin): New. - -2006-10-17 Werner Koch - - * estream.c (struct estream_internal, es_initialize) - (es_deinitialize, print_fun_writer, es_print): New and modified - functions to avoid tempfiles for printf style printing. - - * Makefile.am (libcommonpth_a_SOURCES): New. We now build a secon - version of the library with explicit Pth support. - * exechelp.c, estream.c: Make use of WITHOUT_GNU_PTH. - -2006-10-08 Werner Koch - - * gpgrlhelp.c: Trun all functions into dummies if readline is not - available. - -2006-10-06 Werner Koch - - * Makefile.am (AM_CFLAGS): Use PTH version of libassuan. - - * util.h (GNUPG_GCC_A_SENTINEL): Defined for gcc >= 4. - -2006-10-04 David Shaw - - * gpgrlhelp.c: readline requires stdio.h. - -2006-10-04 Werner Koch - - * membuf.c (init_membuf_secure): New. - (put_membuf): Make sure that ERRNO is set even if the underlying - malloc code does not work properly. - (get_membuf): Set ERRNO on error. - (get_membuf): Allow to pass LEN as NULL. - -2006-10-02 Werner Koch - - * iobuf.c (iobuf_unread): Removed. This code is not required. - Also removed the entire unget buffer stuff. - -2006-09-27 Werner Koch - - * util.h: Do not include strsep.h and strpbrk.h. - (isascii): Removed as it is now in jnlib. - - * iobuf.c (pop_filter, underflow, iobuf_close): Free the unget - buffer. - -2006-09-27 Florian Weimer (wk) - - * iobuf.c (iobuf_unread): New. - -2006-09-22 Werner Koch - - * i18n.h: Changed license to an all permissive one. - - * ttyio.c (tty_get): We need to use readline too. Added two more - hooks. - -2006-09-21 Werner Koch - - * ttyio.c (tty_private_set_rl_hooks): New. - (tty_enable_completion, tty_disable_completion): Use a hook to - enable readline support. Now always available. - (tty_cleanup_rl_after_signal): New. - - * ttyio.h: Removed readline specific stuff. Included util.h. - * common-defs.h: New. - -2006-09-15 Werner Koch - - * convert.c: New. - (hexcolon2bin): New. - (bin2hex, bin2hexcolon, do_binhex): New. - * t-convert.c: New - -2006-09-14 Werner Koch - - * util.h (out_of_core): Use new gpg_error_from_syserror function. - - * http.c (init_sockets): Changed it to require 2.2 unless it is - build within gnupg 1 where we require 1.1 (and not anymore allow - for 1.0). - -2006-09-07 Werner Koch - - * exechelp.c (gnupg_spawn_process): Factor out post fork code to .. - (do_exec): .. new function. Allow passing of -1 for the fds. - (gnupg_spawn_process): Terminate gcrypt's secure memory in the child. - (gnupg_spawn_process_detached): New. - -2006-09-06 Werner Koch - - * maperror.c: Removed. - - * util.h (out_of_core): New. - -2006-09-04 Werner Koch - - * http.c (http_get_header): New. - (capitalize_header_name, store_header): New. - (parse_response): Store headers away. - (send_request): Return GPG_ERR_NOT_FOUND if connect_server failed. - * http.h: New flag HTTP_FLAG_NEED_HEADER. - -2006-08-21 Werner Koch - - * Makefile.am (libcommon_a_SOURCES): Added keyserver.h - - * openpgpdefs.h: New. Stripped from ..g10/packet.h. - -2006-08-16 Werner Koch - - * keyserver.h: Moved from ../include to here. - - * http.c: Include srv.h. - - * srv.c, srv.h: New. Taken from GnuPG 1.4 - -2006-08-14 Werner Koch - - * http.h (struct http_context_s): Moved to implementation. - * http.c (http_open): Changed call to return a context. - (http_open_document): Ditto. - (http_get_read_ptr, http_get_read_ptr, http_get_status_code): New. - (do_parse_uri): Replaced strlwr by straight code to ease - standalone use of this file. - (http_wait_response): Removed arg STATUS_CODE as it is available - through an accessor function. Adjusted caller. - (http_escape_string): New. - - * estream.c (es_read_line): Renamed to .. - (doreadline): .. this. Changed all callers. - (es_read_line): New. This is theusual limited getline variabnt as - used at several places. Here taken and adjusted from xreadline.c - (es_free): New. - -2006-08-11 Werner Koch - - * http.c: Major internal changes to optionallly support GNUTLS and - ESTREAM. - (http_open): Move initialization of the stream ... - (send_request): .. here. - (http_register_tls_callback): New. - - * estream.c (es_writen): Try to seek only is a seek function has - been registered. - -2006-08-09 Werner Koch - - * http.c, http.h: New. Taken from gnupg 1.4.5, merged with - changes done for the Dirmngr project (by g10 Code) and cleaned up - some stuff. - (make_header_line): New. Change all caller to make user of the new - * Makefile.am (libcommon_a_SOURCES): Added http.c and http.h. - -2006-05-23 Werner Koch - - * gettime.c (isotimestamp): New. - - * ttyio.c (tty_get_ttyname): Posixly correct usage of ctermid. - - * dns-cert.c: New. Taken from 1.4.3's util/cert.c. - * dns-cert.h: New. - -2006-05-22 Werner Koch - - * pka.c: New. Taked from 1.4.3. - * pka.h: New. - * Makefile.am: Added pka. - -2006-05-19 Werner Koch - - * yesno.c (answer_is_yes_no_default, answer_is_yes_no_quit): - Updated from 1.4.3. - (answer_is_okay_cancel): new. From 1.4.3. - - * miscellaneous.c (match_multistr): New. Taken from 1.4.3. - - * ttyio.c (tty_enable_completion, tty_disable_completion): New - dummy functions. - * ttyio.h: Add prototypes and stubs. - -2006-04-19 Werner Koch - - * iobuf.c (iobuf_get_fd): New. Taken from 1.4.3. - (iobuf_is_pipe_filename): New. - (pop_filter): Made static. - (iobuf_skip_rest): New. Orginal patch by Florian - Weimer. Added new argument PARTIAL. - (block_filter): Remove the old gpg indeterminate length mode. - (block_filter): Properly handle a partial body stream - that ends with a 5-byte length that happens to be zero. - (iobuf_set_block_mode, iobuf_in_block_mode): Removed as - superfluous. - (iobuf_get_filelength): New arg OVERFLOW. - (iobuf_get_filelength) [W32]: Use GetFileSizeEx if available - * miscellaneous.c (is_file_compressed): Take care of OVERFLOW. - -2006-04-18 Werner Koch - - * homedir.c (w32_shgetfolderpath): New. Taken from gpg 1.4.3. - (default_homedir): Use it. - -2005-10-08 Marcus Brinkmann - - * signal.c (get_signal_name): Check value of HAVE_DECL_SYS_SIGLIST - instead of just if it is defined. - -2005-09-28 Marcus Brinkmann - - * Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS). - -2005-07-04 Marcus Brinkmann - - * simple-pwquery.h (simple_pwclear): New prototype. - * simple-pwquery.c (simple_pwclear): New function. - -2005-06-15 Werner Koch - - * miscellaneous.c (make_printable_string): Made P a void*. - - * sexputil.c (keygrip_from_canon_sexp, cmp_simple_canon_sexp): - Fixed signed/unsigned pointer mismatch. - (make_simple_sexp_from_hexstr): Ditto. This is all too ugly; I - wonder why gcc-4's default is to warn about them and forcing us to - use cast the warning away. - * iobuf.c (block_filter): Ditto. - (iobuf_flush): Ditto. - (iobuf_read_line): Ditto. - (iobuf_read): Make BUFFER a void *. - (iobuf_write): Make BUFFER a const void *. - * ttyio.c (tty_print_utf8_string2): Ditto. - * estream.c (estream_cookie_mem): Make MEMORY unsigned char*. - (es_write): Make BUFFER a void *. - (es_writen): Ditto. - (es_func_fd_read, es_func_fd_write, es_func_mem_read) - (es_func_mem_write): Ditto. - (es_read, es_readn): Ditto. - (es_func_mem_write): Made MEMORY_NEW an unsigned char *. - * estream.h (es_cookie_read_function_t) - (es_cookie_write_function_t): Changed buffer arg to void*. - -2005-06-03 Werner Koch - - * estream.c: Use HAVE_CONFIG_H and not USE_CONFIG_H! - (es_func_fd_read, es_func_fd_write): Protect against EINTR. - -2005-06-01 Werner Koch - - * Makefile.am (AM_CPPFLAGS): Added. - - * util.h: Add some includes for gnulib. - (ttyname, isascii): Define them inline. - * fseeko.c, ftello.c: Removed. - * strsep.c, mkdtemp.c: Removed. - * ttyname.c, isascii.c: Removed. - -2005-05-31 Werner Koch - - * dynload.h: s/__inline__/inline/. - -2005-05-13 Werner Koch - - * signal.c (got_fatal_signal): Print the signal number if we can't - get a name for it. - (get_signal_name): Return NULL if no name is available. Fixed - conditional for sys_siglist to the correct one. - -2005-04-17 Werner Koch - - * sexputil.c (cmp_simple_canon_sexp): New. - (make_simple_sexp_from_hexstr): New. - -2005-04-07 Werner Koch - - * sexputil.c: New. - -2005-04-11 Marcus Brinkmann - - * simple-pwquery.c (simple_pwquery): Use spwq_secure_free. - -2005-03-03 Werner Koch - - * Makefile.am (AM_CFLAGS): Added PTH_CFLAGS. Noted by Kazu Yamamoto. - -2005-02-25 Werner Koch - - * xasprintf.c (xtryasprintf): New. - -2005-01-26 Moritz Schulte - - * Makefile.am (libcommon_a_SOURCES): New source files: estream.c, - estream.h. - * estream.c, estream.h: New files. - -2005-01-03 Werner Koch - - * asshelp.c (send_pinentry_environment): Fixed changed from - 2004-12-18; cut+paste error for lc-messages. - -2004-12-21 Werner Koch - - * simple-pwquery.c (agent_open) [W32]: Implement for W32. - (readline) [W32]: Use recv instead of read. - (writen) [W32]: Use send instead of write. - (my_stpcpy): Define a stpcpy replacement so that this file - continues to be self-contained. - (agent_send_all_options) [W32]: Don't call ttyname. - -2004-12-21 Marcus Brinkmann - - * simple-pwquery.h (simple_query): Add prototype. - * simple-pwquery.c (simple_query): New function. - -2004-12-21 Werner Koch - - * signal.c (got_fatal_signal, got_usr_signal) - (got_fatal_signal) [DOSISH]: Don't build. - * simple-gettext.c: Include sysutils.h - - * homedir.c: New. Use CSIDL_APPDATA for W32 as the default home - directory. - * Makefile.am (libcommon_a_SOURCES): Add it. - (EXTRA_DIST): Removed mkerror and mkerrtok. - -2004-12-20 Werner Koch - - * sysutils.h [W32]: Define sleep. - * util.h: Add prototype for mkdtemp. - - * membuf.c (put_membuf): Wipe out buffer after a failed realloc. - -2004-12-19 Werner Koch - - * maperror.c (map_assuan_err_with_source): Oops, args were swapped. - -2004-12-18 Werner Koch - - * maperror.c (map_assuan_err): Renamed to .. - (map_assuan_err_with_source): .. this and add arg SOURCE.c - * asshelp.c (send_pinentry_environment, send_one_option): Add arg - ERRSOURCE. - -2004-12-15 Werner Koch - - * sysutils.h [W32]: Prototypes for registry functions. - * w32reg.c: Include sysutils.h - - * simple-pwquery.c [W32]: Dummy code to allow a build. - - * exechelp.c [W32]: Implemented for W32 . - - * ttyname.c: New. - - * asshelp.c (send_one_option): New. - (send_pinentry_environment): Cleaned up and made sure that empty - values are not send. - -2004-12-07 Werner Koch - - * asshelp.c (send_pinentry_environment) [W32]: Do not use ttyname. - -2004-12-06 Werner Koch - - * exechelp.h, exechelp.c: New. Based on code from ../sm/import.c. - -2004-12-03 Werner Koch - - * strsep.c: Fixed copyright comments. - -2004-11-26 Werner Koch - - * simple-gettext.c: New taken from gnupg 1.3.x - - * simple-pwquery.c [_WIN32]: Include winsock2.h. - (agent_open): Disable it until we have our AF_UNIX implementation - ready. - * fseeko.c, ftello.c: Include sys/types for the sake of W32. - -2004-11-23 Werner Koch - - * b64enc.c: Include stdio.h and string.h - -2004-08-18 Werner Koch - - * simple-pwquery.c (simple_pwquery): Handle gpg-error style return - code for canceled. - -2004-07-20 Werner Koch - - * maperror.c: Removed header ksba.h. Not required anymore. - -2004-06-14 Werner Koch - - * xreadline.c: New. Based on the iobuf_read_line function. - -2004-05-12 Werner Koch - - * util.h (xtrycalloc_secure,xtrymalloc_secure): New. - -2004-05-11 Werner Koch - - * sysutils.c (disable_core_dumps): Only set the current limit. - (enable_core_dumps): New. - -2004-04-13 Werner Koch - - * simple-pwquery.c (copy_and_escape): Relaxed quoting. - -2004-04-05 Werner Koch - - * errors.h (STATUS_NEWSIG): New. - -2004-03-11 Werner Koch - - * dynload.h [__MINGW32__]: Define RTLD_LAZY. - -2004-03-09 Werner Koch - - * maperror.c (map_assuan_err): Map the Locale_Problem item. - -2004-03-03 Werner Koch - - * asshelp.c, asshelp.h: New. - (send_pinentry_environment): New. Code taken from ../sm/call-agent.c. - -2004-02-19 Werner Koch - - * simple-pwquery.c (agent_open): Don't mangle INFOSTR. - -2004-02-17 Werner Koch - - * simple-pwquery.c (agent_open): Ignore an empty GPG_AGENT_INFO. - - * errors.h: Added STATUS_IMPORT_OK. - -2004-02-10 Werner Koch - - * b64enc.c: New. Based on code from ../sm/base64.c. - -2004-01-30 Marcus Brinkmann - - * Makefile.am (libcommon_a_SOURCES): Add xasprintf.c. - * miscellaneous.c (xasprintf): Moved to ... - * xasprintf (xasprintf): ... here. New file. - This allows to use xasprintf without sucking in gpg-error. - -2004-01-27 Werner Koch - - * sexp-parse.h: New; moved from../agent. - - * util.h (xtoi_4): New. - -2003-12-23 Werner Koch - - * maperror.c (map_assuan_err): Prepared for a new error code. - -2003-12-17 Werner Koch - - * gettime.c (asctimestamp): Add a note on a non-avoidable gcc warning. - - * util.h [!HAVE_VASPRINTF]: Add printf format attribute to the - replacement function. - - * miscellaneous.c (xasprintf): New. - -2003-11-14 Werner Koch - - * mkdtemp.c (mkdtemp): Use gcry_create_nonce. - - * cryptmiss.c: Removed. - -2003-11-13 Werner Koch - - * util.h (vasprintf): Also fixed the prototype. - - * vasprintf.c (vasprintf): ARGS should not be a pointer. Fixed - segv on Solaris. Reported by Andrew J. Schorr. - -2003-11-12 Werner Koch - - * maperror.c (map_ksba_err, map_gcry_err, map_kbx_err): Removed. - -2003-10-31 Werner Koch - - * util.h (gnupg_isotime_t): New. - (gnupg_copy_time): New. - - * gettime.c (gnupg_get_isotime): New. - -2003-09-23 Werner Koch - - * iobuf.c (check_special_filename): Replaced is isdigit by digitp - to avoid passing negative values and potential locale problems. - Problem noted by Christian Biere. - - * util.h (ascii_isspace): New. - -2003-09-18 Werner Koch - - * ttyio.c (tty_fprintf): New. - (tty_print_string, tty_print_utf8_string2) - (tty_print_utf8_string): Made P argument const byte*. - -2003-08-20 Marcus Brinkmann - - * maperror.c (map_ksba_err): Map -1. Use gpg_err_make to set - the error source. - -2003-08-14 Timo Schulz - - * dynload.h. New. W32 wrapper around the dynload mechanism. - -2003-07-15 Werner Koch - - * simple-pwquery.c, simple-pwquery.h: New; moved from ../agent. - * Makefile.am (libsimple_pwquery_a_LIBADD): New. - -2003-06-25 Werner Koch - - * maperror.c (map_to_assuan_status): Directly map 0 to 0. - -2003-06-17 Werner Koch - - * gettime.c (scan_isodatestr,add_days_to_timestamp,strtimevalue) - (strtimestamp,asctimestamp): New. Code taken from gnupg 1.3.2 - mischelp.c. - - * yesno.c: New. Code taken from gnupg 1.3.2 mischelp.c - - * miscellaneous.c: New. - - * util.h: Include utf8conf.h - -2003-06-16 Werner Koch - - * gettime.c (make_timestamp): New. - - * ttyio.c: New. Taken from gnupg 1.2. - * ttyio.h: Move from ../include. - -2003-06-13 Werner Koch - - * util.h (seterr): Removed macro. - (xmalloc_secure,xcalloc_secure): New. - -2003-06-11 Werner Koch - - * iobuf.c (iobuf_writebyte,iobuf_write): Return error code from - iobuf_flush. - (iobuf_writestr): Ditto. - -2003-06-10 Werner Koch - - * iobuf.c, iobuf.h: New. Taken from current gnupg 1.3 CVS. Run - indent on it and adjusted error handling to libgpg-error style. - Replaced IOBUF by iobuf_t. Renamed malloc functions. - -2003-06-04 Werner Koch - - * errors.h: Removed all error codes. We keep the status codes for - now. - * Makefile.am: Do not create errors.c anymore; remove it from the - sources. - - * maperror.c: Don't include error.h. Change all error codes to - libgpg-error style. - (map_assuan_err): Changed to new Assuan error code convention. - (map_to_assuan_status): Likewise. - (map_gcry_err,map_kbx_err): Not needed. For now dummy functions. - - * membuf.c, membuf.h: New. Code taken from ../sm/call-agent.h. - * Makefile.am: Added above. - -2003-04-29 Werner Koch - - * util.h (fopencokokie): Removed prototype and struct. - - * fopencookie.c: Removed. - - * maperror.c: Use system assuan.h - -2002-10-31 Neal H. Walfield - - * isascii.c: New file. - * putc_unlocked.c: Likewise. - -2002-10-28 Neal H. Walfield - - * signal.c (caught_fatal_sig): Remove superfluous zero - initializer. - (caught_sigusr1): Likewise. - -2002-09-04 Neal H. Walfield - - * vasprintf.c (vasprintf) [va_copy]: Use va_copy. - [!va_copy && __va_copy]: Use __va_copy. - [!va_copy && !__va_copy]: Only now fall back to using memcpy. - -2002-08-21 Werner Koch - - * errors.h: Added STATUS_IMPORT_PROBLEM. - -2002-08-20 Werner Koch - - * vasprintf.c: Hack to handle NULL for %s. - -2002-08-09 Werner Koch - - * signal.c: New. Taken from GnuPG 1.1.91. - -2002-07-23 Werner Koch - - * util.h (_IO_cookie_io_functions_t): Fixed typo. Noted by - Richard Lefebvre. - -2002-07-22 Werner Koch - - * fseeko.c, ftello.c: New. - -2002-06-28 Werner Koch - - * maperror.c (map_to_assuan_status): Map more errorcodes to Bad - Certificate. - -2002-06-26 Werner Koch - - * maperror.c (map_to_assuan_status): Map EOF to No_Data_Available. - -2002-06-10 Werner Koch - - * errors.h (gnupg_error_token): Add new prototype. - (STATUS_ERROR): New. - - * mkerrtok: New. - * Makefile.am: Use it to create the new error token function. - -2002-06-04 Werner Koch - - * maperror.c (map_to_assuan_status): Map Bad_CA_Certificate. - -2002-05-23 Werner Koch - - * no-pth.c, Makefile.am: Removed. - -2002-05-22 Werner Koch - - * mkdtemp.c: Replaced byte by unsigned char because it is no longer - defined in gcrypt.h. - -2002-05-21 Werner Koch - - * maperror.c (map_gcry_err): Add libgcrypt's new S-expression errors. - (map_ksba_err): Add a few mappings. - -2002-05-14 Werner Koch - - * gettime.c: New. - -2002-05-03 Werner Koch - - * errors.h: Added STARUS_EXPSIG and STATUS_EXPKEYSIG. - -2002-04-15 Werner Koch - - * cryptmiss.c: New. - -2002-02-14 Werner Koch - - * maperror.c: Add more assuan<->gnupg mappings. - -2002-02-12 Werner Koch - - * fopencookie.c: Dummy function. - - * vasprintf.c: New. Taken from binutils-2.9.1 and dropped all non - ANSI-C stuff. Merged with asprintf version. - - * no-pth.c: New. - -2002-01-23 Werner Koch - - * mkdtemp.c: Copied from gnupg-1.0.6c and changed to use libgcrypt. - -2002-01-19 Werner Koch - - * sysutils.c: New. This is the misc.c file from gnupg 1.0.6 with - the OpenPGP stuff removed. - * sysutils.h: New. - -2002-01-15 Werner Koch - - * maperror.c: Add mapping for Not_Trusted. - -2002-01-11 Werner Koch - - * maperror.c (map_assuan_err): Codes for CRL - -2002-01-08 Werner Koch - - * util.h (spacep): New. - -2002-01-02 Werner Koch - - * maperror.c (map_to_assuan_status): New. Merged from ../agent - and ../sm. - -2001-12-20 Werner Koch - - * maperror.c (map_gcry_err): Add some mappings. - -2001-12-18 Werner Koch - - * Makefile.am (AM_CPPFLAGS): Include flags for gcrypt and ksba - -2001-12-14 Werner Koch - - * util.h (digitp, hexdigitp): New ctype like macros. - (atoi_1,atoi_2,atoi_4,xtoi_1,xtoi_2): New. - - - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010, 2011 Free Software Foundation, Inc. - - This file is free software; as a special exception the author gives - unlimited permission to copy and/or distribute it, with or without - modifications, as long as this notice is preserved. - - This file is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY, to the extent permitted by law; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/common/ChangeLog-2011 b/common/ChangeLog-2011 new file mode 100644 index 000000000..7fed0a742 --- /dev/null +++ b/common/ChangeLog-2011 @@ -0,0 +1,2494 @@ +2011-12-01 Werner Koch + + NB: ChangeLog files are no longer manually maintained. Starting + on December 1st, 2011 we put change information only in the GIT + commit log, and generate a top-level ChangeLog file from logs at + "make dist". See doc/HACKING for details. + +2011-11-30 Werner Koch + + Rewrite dns-cert.c to not use the gpg-only iobuf stuff. + * dns-cert.c: Remove iobuf.h. + (get_dns_cert): Rename to _get_dns_cert. Remove MAX_SIZE arg. + Change iobuf arg to a estream-t. Rewrite function to make use of + estream instead of iobuf. Require all parameters. Return an + gpg_error_t error instead of the type. Add arg ERRSOURCE. + * dns-cert.h (get_dns_cert): New macro to pass the error source to + _gpg_dns_cert. + * t-dns-cert.c (main): Adjust for changes in get_dns_cert. + + * estream.c (es_fopenmem_init): New. + * estream.h (es_fopenmem_init): New. + +2011-11-29 Werner Koch + + * estream.c (func_mem_create): Don't set FUNC_REALLOC if GROW is + not set. Require FUNC_REALLOC if DATA is NULL and FUNC_FREE is + given. + + * dns-cert.c: Use new CERTTYPE_ constants for better readability. + +2011-11-28 Werner Koch + + * t-dns-cert.c (main): Increase MAX_SIZE to 64k. + + * dns-cert.c (get_dns_cert): Factor test code out to ... + * t-dns-cert.c: new file. + +2011-10-24 Werner Koch + + * dotlock.h, dotlock.c: Add alternative to allow distribution of + these files under a modified BSD license + +2011-09-30 Werner Koch + + Change the license of all JNLIB parts from LPGLv3+ to to LGPLv3+ + or GPLv2+. + + * dotlock.h (DOTLOCK_EXT_SYM_PREFIX): New macro. + +2011-09-29 Werner Koch + + * dotlock.c (DOTLOCK_USE_PTHREAD): New macro. + [DOTLOCK_USE_PTHREAD] (all_lockfiles_mutex): New. + (LOCK_all_lockfiles, UNLOCK_all_lockfiles): New. Use them to + protect access to all_lockfiles. + (dotlock_set_fd, dotlock_get_fd): New. + +2011-09-28 Werner Koch + + * dotlock.c (dotlock_take, dotlock_take_unix, dotlock_take_w32): + Implement arbitrary timeout values. + (dotlock_create): Add arg FLAGS for future extensions. + +2011-09-27 Werner Koch + + * dotlock.c (dotlock_take_unix): Check only the link count and not + the error return from link. + (use_hardlinks_p): New. + (dotlock_create_unix): Test for hardlinks. + (dotlock_take_unix): Implement O_EXCL locking. + +2011-09-23 Werner Koch + + * dotlock.c: Factor Unix and W32 specific code out into specific + functions. Define HAVE_POSIX_SYSTEM. Rearrange some functions. + (disable_dotlock): Rename to dotlock_disable. + (create_dotlock): Rename to dotlock_create. + (destroy_dotlock): Rename to dotlock_destroy. + (make_dotlock): Rename to dotlock_take. + (release_dotlock): Rename to dotlock_release. + +2011-09-22 Werner Koch + + * dotlock.c: Remove support for RISCOS. + +2011-08-10 Werner Koch + + * t-exechelp.c (test_close_all_fds): Don't use the DUMMY_FD var. + + * pka.c (get_pka_info): Remove unused var. + + * signal.c (got_fatal_signal): Remove unused var. + + * estream.c (es_fread, es_fwrite): Remove unused var. + +2011-07-20 Werner Koch + + * ssh-utils.c, ssh-utils.h: New. + * t-ssh-utils.c: New. + * Makefile.am (t_ssh_utils_LDADD): New. + (module_tests): Add t-ssh-utils.c + +2011-06-01 Marcus Brinkmann + + * util.h: Undef snprintf before redefining it. + +2011-05-20 Werner Koch + + * util.h: Remove some error code substitutes. + +2011-04-25 Werner Koch + + * userids.c (classify_user_id): Add arg OPENPGP_HACK to fix + regression from 2009-12-08. + +2011-04-01 Werner Koch + + * sysutils.c (get_uint_nonce): New. + +2011-03-03 Werner Koch + + * estream.c (struct estream_list): Rename to estream_list_s and + simplify. A double linked list is overkill for our purpose. + (do_list_add, do_list_remove): Adjust accordingly. + (_es_get_std_stream): Ditto. + (do_list_iterate, estream_iterator_t): Remove; it is used only at + one place. + (es_fflush): Replace iteration function. Also lock each stream + while flushing all streams. + +2011-02-27 Werner Koch + + * gettime.c (isotime2epoch): Factor check code out to .. + (isotime_p): .. new. + (isotime_human_p): New. + (string2isotime): New. + * t-gettime.c (test_string2isotime): New. + +2011-02-11 Andrey Jivsov + + * openpgp-oid.c (openpgp_oid_to_str): Use unsigned int for + get_opaque. Fixes a bug on 64 bit platforms. + +2011-02-08 Werner Koch + + * http.c (connect_server): Add arg R_HOST_NOT_FOUND. + +2011-02-07 Werner Koch + + * http.c (my_socket_new, my_socket_ref, my_socket_unref): New. + (cookie_close, cookie_read, cookie_write, http_close, _http_open) + (send_request): Replace use of an socket integer by the new socket + object. + (_http_raw_connect): New. + (fp_onclose_notification): New. + (_http_raw_connect, _http_wait_response, http_close): Register and + unregister this notification. + * http.h (http_raw_connect): New. + + * http.h (parsed_uri_s): Add field IS_OPAQUE. + (http_req_t): Add HTTP_REQ_OPAQUE. + * http.c (do_parse_uri): Parse unknown schemes into PATH. + (my_socket_new, my_socket_ref, my_socket_unref): New. + (send_request): Simplify save_errno stuff. + +2011-02-03 Werner Koch + + * status.h (STATUS_DECRYPTION_INFO): New. + + * argparse.c (strusage): Update copyright year. + +2011-01-31 Werner Koch + + * openpgp-oid.c: New. + * t-openpgp-oid.c: New. + +2011-01-20 Werner Koch + + Fix bug#1313. + + * http.c (my_select): New. Define to pth_select if building with Pth. + (start_server, write_server, cookie_read, cookie_write): Use it. + (my_connect): New. Define to pth_connect if building with Pth. + (connect_server): Use it. + (my_accept): New. Define to pth_accept if building with Pth. + (start_server): Use it. + +2011-01-20 Werner Koch + + * util.h (struct b64state): Add field LASTERR. + * b64enc.c (enc_start, b64enc_write, b64enc_finish): Handle + LASTERR. This is to make sure that we don't leak strduped data. + * b64dec.c (b64dec_start, b64dec_proc, b64dec_finish): Ditto. + + * http.c (escape_data): New. + (insert_escapes): Implement using escape_data. + (http_escape_data): New. + +2011-01-19 Werner Koch + + * homedir.c (gnupg_module_name): Use NAME_OF_INSTALLED_GPG instead + of "gpg2". + +2011-01-18 Werner Koch + + * iobuf.c (file_es_filter_ctx_t): New. + (file_es_filter): New. + (iobuf_esopen): New. + + * membuf.c (clear_membuf, peek_membuf): New. + + * util.h (GPG_ERR_NO_KEYSERVER): New. + + * keyserver.h (keyserver_spec): Move from ../g10/options.h to here. + + * http.c (do_parse_uri): Add arg NO_SCHEME_CHECK. Change all + callers. Support HKP and HKPS. + (_http_parse_uri): Do proper error management. + * http.h (parsed_uri_s): Add field IS_HTTP. + (http_parse_uri): Support NO_SCHEME_CHECK arg. + + * estream.c (es_func_mem_write): Fix computation of NEWSIZE. + +2011-01-10 Werner Koch + + * session-env.c (update_var): Fix same value detection. Fixes + bug#1311. + +2010-12-17 Werner Koch + + * asshelp.c (lock_spawning): Add arg VERBOSE. Improve timeout + management. Make callers pass a value for VERBOSE. + (lock_agent_spawning, unlock_agent_spawning): Remove. Change + callers to use lock_spawning and unlock_spawning. + +2010-12-17 Marcus Brinkmann + + * homedir.c (gnupg_cachedir): Create /temp subdirectories. + +2010-12-02 Werner Koch + + * miscellaneous.c (gnupg_cipher_algo_name): New. Replace all + users of gcry_cipher_algo_name by this one. + + * logging.c (fun_cookie_s) [W32CE]: Add field USE_WRITEFILE. + (fun_writer) [W32CE]: Make use of it. + (set_file_fd) [W32CE]: Implement special filename "GPG2:". + +2010-11-25 Werner Koch + + * asshelp.c (start_new_gpg_agent): Change style of startup info. + (start_new_dirmngr): Ditto. + +2010-11-23 Werner Koch + + * asshelp.c (SECS_TO_WAIT_FOR_AGENT, SECS_TO_WAIT_FOR_DIRMNGR): + Use these constants. For W32CE increase them to 30 seconds. + (start_new_gpg_agent): Print time to startup agent. + (start_new_dirmngr): Ditto. + +2010-11-04 Werner Koch + + * logging.c (do_logv) [W32]: Don't set a default log stream if the + registry entry is empty. + +2010-10-27 Werner Koch + + * gettime.c (gnupg_get_isotime): Compare to (time_t)-1. + (epoch2isotime): Ditto. + (IS_INVALID_TIME_T): New. + (asctimestamp): Use new macro. + (strtimestamp, isotimestamp): Ditto. Use snprintf. + +2010-10-25 Werner Koch + + * logging.c (do_log): Rename to log_log and make global. + +2010-10-20 Werner Koch + + * i18n.c (i18n_init) [USE_SIMPLE_GETTEXT]: Call textdomain. + +2010-10-14 Werner Koch + + * asshelp.c (start_new_gpg_agent): Print a notice once the agent + has been started. + (start_new_dirmngr): Likewise. + +2010-10-13 Werner Koch + + * miscellaneous.c (parse_version_number, parse_version_string) + (gnupg_compare_version): New. + +2010-10-04 Werner Koch + + * gettime.c (asctimestamp) [W32CE]: Do not print the timezone. + +2010-09-30 Werner Koch + + * util.h (GPG_ERR_FULLY_CANCELED): Add replacement. + +2010-09-17 Werner Koch + + * http.c (INADDR_NONE): Provide fallback. + * logging.c (INADDR_NONE): Ditto. + +2010-09-16 Werner Koch + + * util.h: Add GPG_ERR_MISSING_ISSUER_CERT. + * status.c (get_inv_recpsgnr_code): Ditto. + +2010-09-13 Werner Koch + + * homedir.c (gnupg_bindir) [W32CE]: Change to bin/. + (gnupg_libexecdir) [W32]: Call gnupg_bindir. + (gnupg_libdir, gnupg_datadir, gnupg_localedir) [W32]: Simplify by + using xstrconcat. + (gnupg_module_name): Ditto. + (w32_rootdir): Strip a trailing "bin". + +2010-09-02 Werner Koch + + * util.h (GPG_ERR_NOT_INITIALIZED): Define if not defined. + +2010-09-01 Marcus Brinkmann + + * estream.c (_es_set_std_fd): Disable debug output. + +2010-08-26 Werner Koch + + * estream.c (es_convert_mode): Rename to parse_mode. + (parse_mode): Add arg R_CMODE and parse key value pairs. Use Use + 664 as the default mode. Change callers. + (ES_DEFAULT_OPEN_MODE): Remove. + (es_fopen, do_fpopen, do_w32open, es_freopen): Support a creation + mode. + (es_func_file_create): Rename to func_file_create and add arg CMODE. + (es_func_fd_create): Rename to func_fd_create. + (es_func_fp_create): Rename to func_fp_create. + (es_list_add): Rename to do_list_add. + (es_list_remove): Rename to do_list_remove. + (es_list_iterate): Rename to do_list_iterate. + (es_pth_read): Rename to do_pth_read. + (es_deinit): Rename to do_deinit. + (es_init_do): Rename to do_init. + (es_func_mem_create): Rename to func_mem_create. + +2010-08-23 Werner Koch + + * exechelp-w32ce.c: Rewrite all spawn stuff. + + * exechelp-w32.c (close_all_fds) [W32]: Make it a dummy function. + + * estream.c (es_onclose): New. + (notify_list_t, onclose): New. + (struct estream_internal): Add field ONCLOSE. + (es_initialize, es_deinitialize): Manage new field. + (do_close): Call onclose notify functions. + +2010-08-20 Werner Koch + + * exechelp-w32.c (create_inheritable_pipe): Change arg to HANDLE. + + * estream.h (es_sysopen_t): New. + * estream.c (es_func_w32_create, es_func_w32_read) + (es_func_w32_write, es_func_w32_seek, es_func_w32_destroy) + (estream_functions_w32, estream_cookie_fd): New. Only for W32. + (es_sysopen, es_sysopen_nc): New. + (do_w32open, do_sysopen): New. + (es_syshd, es_syshd_unlocked): New. + (struct estream_internal): Replace filed FD by SYSHD. + (es_initialize): Clear SYSHD_VALID. + (map_w32_to_errno): New. + (es_get_fd): Remove. + (es_fileno_unlocked): Re-implement using es_syshd. + (es_initialize, es_create): Replace arg FD by SYSHD. + (es_fopen, es_mopen, es_fopenmem, do_fdopen, do_fpopen) + (es_tmpfile): Use SYSHD instead of FD. + (es_destroy): Rename to do_close. + +2010-08-19 Werner Koch + + * exechelp-posix.c (create_pipe_and_estream): New. + (gnupg_spawn_process): Rework this function and its calling + convention; it is not used anyway. + * exechelp-w32.c (gnupg_spawn_process): Ditto. + +2010-08-18 Werner Koch + + * logging.c (writen): Add arg IS_SOCKET. + (fun_writer): Pass the is_socket flag. + (do_logv) [W32]: Allow for a default log stream + + * estream.c (struct estream_internal): Remove obsolete fields + PRINT_FP, PRINT_ERRNO, PRINT_ERR and all remaining code cruft. + +2010-08-16 Werner Koch + + * estream.c (es_printf_unlocked, es_printf): New. + + * asshelp.c (lock_agent_t): Rename to lock_spawn_t. + (lock_agent_spawning, unlock_agent_spawning): Factor code out to ... + (lock_spawning, unlock_spawning): .. new. + (start_new_gpg_agent): Make more use of ERRSOURCE. + (start_new_dirmngr): New. + +2010-08-13 Werner Koch + + * Makefile.am (audit-events.h, status-codes.h): Fix srcdir problem + amd depend on Makefile.am instead of Makefile. + +2010-08-12 Werner Koch + + * sysutils.c (gnupg_remove) [W32CE]: Fix returned error. + +2010-08-09 Werner Koch + + * logging.c (WITH_IPV6): New macro. + (parse_portno): New. From libassuan. + (fun_writer): Support TCP logging on all platforms. + (sock_close): New. + +2010-08-06 Werner Koch + + * homedir.c (dirmngr_socket_name) [W32CE]: Base on default homedir. + (gnupg_cachedir) [W32CE]: Drop drive letter. + + * http.c (http_open_document): Rename to _http_open_document and + add arg ERRSOURCE. Pass ERRSOURCE to all called funcs. + (http_wait_response, http_open, http_parse_uri): Likewise. + (do_parse_uri, parse_response, store_header): Change to return an + gpg_err_code_t. Change callers. + (send_request): Add arg ERRSOURCE. Change callers. + * http.h (http_open_document, http_wait_response, http_open) + (http_parse_uri): Define as macro. + +2010-08-05 Werner Koch + + * estream.h (es_asprintf, es_vasprintf): Add lost prototyps. + + * http.c: Require estream and make HTTP_USE_ESTREAM obsolete. It + make the code unreadable and we require estream anyway for GnuPG. + (http_wait_response): Get use of cookies right. + (send_request): s/xtryasprintf/es_asprintf/ to allow standalone + use of the code. + (insert_escapes, connect_server): s/sprintf/snprintf/. + (parse_response): s/my_read_line/es_read_line/. + (my_read_line): Remove. + (write_server): Use pth_write. + +2010-07-26 Werner Koch + + * estream.c (es_func_fp_write) [W32]: Write smaller chunks. + +2010-07-25 Werner Koch + + * argparse.c (initialize): Use ARGPARSE_PRINT_WARNING constant. + +2010-07-24 Werner Koch + + * estream.c (es_set_binary): New. + +2010-07-19 Werner Koch + + * utf8conv.c (utf8_to_wchar): s/malloc/jnlib_malloc/. + +2010-07-16 Werner Koch + + * http.h (HTTP_FLAG_IGNORE_CL): Add flag . + * http.c (WITHOUT_GNU_PTH): Test macro for Pth support. + (http_parse_uri): s/xcalloc/xtrycalloc/. + (send_request): Replace of discrete allocation and sprintf by + xtryasprintf. + (http_wait_response): Replace HTTP_FLAG_NO_SHUTDOWN by + HTTP_FLAG_SHUTDOWN to change the default to no shutdown. + (cookie_read) [HAVE_PTH]: Use pth_read. + (longcounter_t): New. + (struct cookie_s): Add support for content length. Turn flag + fields into bit types. + (parse_response): Parse content length header. + (cookie_read): Take care of the content length. + +2010-07-08 Werner Koch + + * estream.c (estream_functions_file): Remove and replace by + identical estream_functions_fd. + +2010-07-06 Werner Koch + + * util.h (b64state): Add field STREAM. + * b64enc.c (b64enc_start): Factor code out to .. + (enc_start): new. + (b64enc_start_es, my_fputs): New. + (b64enc_write, b64enc_finish): Support estream. + +2010-06-24 Werner Koch + + * asshelp.c (lock_agent_spawning) [W32]: Use CreateMutexW. + (start_new_gpg_agent): Use HANG option for gnupg_wait_progress. + Fixes regression from 2010-06-09. + +2010-06-21 Werner Koch + + * util.h (xfree_fnc): New. + +2010-06-18 Werner Koch + + * util.h (GPG_ERR_MISSING_KEY) [!GPG_ERR_MISSING_KEY]: New. + + * sexputil.c (make_canon_sexp_pad): Add arg SECURE. + +2010-06-17 Werner Koch + + * sexputil.c (make_canon_sexp_pad): New. + +2010-06-14 Werner Koch + + * membuf.c (put_membuf): Add shortcut for !LEN. + +2010-06-11 Marcus Brinkmann + + * sysutils.c (translate_sys2libc_fd): Revert last change. + (translate_sys2libc_fd_int): Revert last change. + +2010-06-10 Marcus Brinkmann + + * sysutils.c (translate_sys2libc_fd) [HAVE_W32CE_SYSTEM]: + Implement. + (translate_sys2libc_fd_int) [HAVE_W32CE_SYSTEM]: Don't call + translate_sys2libc_fd. + + * estream.c (_es_get_std_stream): Fix cut&paste bug. + +2010-06-09 Werner Koch + + * exechelp-posix.c, exechelp-w32.c + * exechelp-w32ce.c (gnupg_wait_process): Add new arg HANG. Change + all callers. + (gnupg_release_process): New. Use it after all calls to + gnupg_wait_process. + + * util.h (GNUPG_MODULE_NAME_DIRMNGR_LDAP): New. + * homedir.c (gnupg_cachedir): New. + (w32_try_mkdir): New. + (dirmngr_socket_name): Change standard socket name. + (gnupg_module_name): Support GNUPG_MODULE_NAME_DIRMNGR_LDAP. + + * logging.c (log_set_get_tid_callback): Replace by ... + (log_set_pid_suffix_cb): .. new. + (do_logv): Change accordingly. + +2010-06-08 Marcus Brinkmann + + * Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS). + (t_common_ldadd): Add $(LIBASSUAN_LIBS). + * sysutils.c: Include . + (translate_sys2libc_fd_int): Cast to silence gcc warning. + * iobuf.c: Include + (translate_file_handle): Fix syntax error. + +2010-06-08 Werner Koch + + * iobuf.c (translate_file_handle) [W32CE]: Handle rendezvous ids. + +2010-06-07 Werner Koch + + * sysutils.c [W32CE]: Finish pipe creation. + + * estream.c (es_fname_get, es_fname_set): New. + (fname_set_internal): New. + (struct estream_internal): Add fields printable_fname and + printable_fname_inuse. + (_es_get_std_stream): Set stream name. + (es_fopen, es_freopen, es_deinitialize): Set fname. + + * exechelp-posix.c (gnupg_spawn_process): Allow passing INFILE or + OUTFILE as NULL. + * exechelp-w32.c (gnupg_spawn_process): Ditto. + * exechelp-w32ce.c (gnupg_spawn_process): Return an error for + INFILE or OUTFILE passed as NULL. + +2010-06-01 Werner Koch + + * logging.c (log_get_stream): Make sture a log stream is available. + +2010-05-30 Werner Koch + + * init.c (writestring_via_estream): New. + (init_common_subsystems): Register with argparse. + + * argparse.c (argparse_register_outfnc): New. + (writestrings, flushstrings): New. Use them instead of stdout or + stderr based functions. + +2010-05-04 Werner Koch + + * estream.c (_es_get_std_stream): Re-use registered standard fds. + (IS_INVALID_FD, ESTREAM_SYS_YIELD): New. + (es_func_fd_read, es_func_fd_write, es_func_fd_seek) + (es_func_fd_destroy): Implement a dummy stream. + + * exechelp-w32ce.c (build_w32_commandline): Add args FD0_ISNULL + and FD1_ISNULL. Remove arg PGMNAME. Change callers. + (gnupg_spawn_process_detached): Implement. + (gnupg_spawn_process_fd): Implement one special case for now. + +2010-05-03 Werner Koch + + * asshelp.c (lock_agent_spawning, unlock_agent_spawning): New. + (start_new_gpg_agent): Test for configured standard socket and + try to fire up the agent in this case. + + * exechelp-posix.c (gnupg_wait_process): Do not log a message if + EXITCODE is given. + (gnupg_spawn_process_detached): Do not reuse PID for the second fork. + +2010-04-26 Werner Koch + + * utf8conv.c (load_libiconv) [W32CE]: No libiconv warning + + * init.c (init_common_subsystems) [W32CE]: Register the sleep + function before es_init. + +2010-04-20 Werner Koch + + * estream.c (es_deinit): New. + (es_init_do): Install atexit handler to flush all streams. + + * Makefile.am (common_sources): Add gettime.h. + +2010-04-20 Marcus Brinkmann + + * logging.c (do_log_ignore_arg): New helper function. + (log_string): Use it to remove ugly volatile hack that causes gcc + warning. + (log_flush): Likewise. + * sysutils.c (gnupg_unsetenv) [!HAVE_W32CE_SYSTEM]: Return something. + (gnupg_setenv) [!HAVE_W32CE_SYSTEM]: Likewise. + * pka.c (get_pka_info): Solve strict aliasing rule violation. + * t-exechelp.c (test_close_all_fds): Use dummy variables to + silence gcc warning. + +2010-04-15 Werner Koch + + * util.h: Factor time related functions out to ... + * gettime.h: New. + (gnupg_copy_time): Move to ... + * gettime.c (gnupg_copy_time): New. + + * sysutils.c (gnupg_setenv) [!W32CE]: Add missing return. + (gnupg_unsetenv) [!W32CE]: Add missing return. + +2010-04-14 Werner Koch + + * Makefile.am (noinst_LIBRARIES) [W32CE]: Exclude libsimple-pwquery. + + * w32help.h (umask) [W32CE]: New. + + * sysutils.c (_gnupg_isatty): New. + * util.h (gnupg_isatty): New. + + * asshelp.c (setup_libassuan_logging): Read ASSUAN_DEBUG envvar. + (my_libassuan_log_handler): Use it. + * sysutils.c (_gnupg_getenv): Implement ASSUAN_DEBUG. + +2010-04-08 Werner Koch + + * w32help.h (_setmode, setmode) [W32CE]: Provide prototype and + macro. + +2010-04-07 Werner Koch + + * mischelp.c (timegm): Replace unsetenv/putenv by gnupg_unsetenv. + + * sysutils.c: Include setenv.h. + (gnupg_setenv, gnupg_unsetenv): New. + + +2010-04-06 Werner Koch + + * sysutils.c (gnupg_mkdir): New. + +2010-03-29 Werner Koch + + * init.c (sleep_on_exit): Change to 400ms. + +2010-03-25 Werner Koch + + * init.c (sleep_on_exit) [W32CE]: New. + (init_common_subsystems): Call it. + +2010-03-24 Werner Koch + + * stringhelp.c (change_slashes, compare_filenames): Replace + HAVE_DRIVE_LETTERS by HAVE_DOSISH_SYSTEM. + (make_basename, make_dirname): Detect backslashes and drive + letters separately. + + * dotlock.c (make_dotlock, create_dotlock, release_dotlock): Use + LockFileEx and UnlockFileEx to support W32CE. + + * ttyio.c (USE_W32_CONSOLE): Replace all _WIN32 by this. + (init_ttyfp) [W32CE]: Use stderr. + + * iobuf.c (FD_FOR_STDIN, FD_FOR_STDOUT) [W32CE]: Use estream. + (translate_file_handle) [W32CE]: Remove handle translation. + +2010-03-23 Werner Koch + + * sysutils.c (gnupg_remove): New. + +2010-03-22 Werner Koch + + * exechelp-w32ce.c (build_w32_commandline): Replace by code from + libassuan. + (create_inheritable_pipe): Use _assuan_w32ce_prepare_pipe. + (build_w32_commandline_copy, do_create_pipe): Remove. + + * exechelp-posix.c (gnupg_spawn_process): Change to use estream + also for INFILE and STATUSFILE. + * exechelp-w32.c (gnupg_spawn_process): Ditto. + +2010-03-22 Werner Koch + + * exechelp.c: Remove after factoring all code out to ... + * exechelp-posix.c, exechelp-w32.c, exechelp-w32ce.c: .. new. + + * exechelp.c (create_inheritable_pipe_r) + (create_inheritable_pipe_w): Fold both into ... + (create_inheritable_pipe): .. New. Change callers to use this. + (gnupg_create_inbound_pipe, gnupg_create_outbound_pipe): Factor + code out to ... + (do_create_pipe): .. New. + + * init.c (parse_std_file_handles): Change to use rendezvous ids. + +2010-03-15 Werner Koch + + * init.c (init_common_subsystems): Add args ARGCP and + ARGVP. Change all callers to provide them. + (parse_std_file_handles): New. + + * t-sysutils.c (rewind) [W32CE]: Provide a replacement. + + * Makefile.am (module_tests) [W32CE]: Don't build t-exechelp for now. + + * sysutils.c (gnupg_allow_set_foregound_window) [W32CE]: Don't + call AllowSetForegroundWindow. + + * logging.c (isatty) [W32CE]: New. + (fun_writer, set_file_fd): Use estream even for the internal error + messages. + (log_string, log_flush): Make DUMMY_ARG_PTR static. + +2010-03-15 Werner Koch + + * asshelp.c (send_pinentry_environment) [!HAVE_SETLOCALE]: Do not + define OLD_LC. + * http.c (connect_server) [!USE_DNS_SRV]: Mark SRVTAG unused. + * dns-cert.c (get_dns_cert) [!USE_DNS_CERT]: Mark args unused. + * pka.c (get_pka_info): Ditto. + + * signal.c (pause_on_sigusr): Remove. It was used in ancient gpg + version with shared memory IPC. Last caller removed on 2006-04-18. + (do_block) [W32]: Mark arg unused. + + * exechelp.c (w32_open_null): Use CreateFileW. + + * init.c (init_common_subsystems): Add args ARGCP and ARGVP. + Change all callers to pass them. + + * logging.c (S_IRGRP, S_IROTH, S_IWGRP, S_IWOTH) [W32]: New. + (fun_writer, set_file_fd) [W32]: Disable socket code. + + * localename.c: Include gpg-error.h. + + * util.h (GPG_ERR_NOT_ENABLED): Remove this temporary definition. + +2010-03-12 Werner Koch + + * status.h (STATUS_ENTER): New. + + * ttyio.c (tty_fprintf): Change to use estream. + + * miscellaneous.c (print_utf8_string): Rename to print_utf8_buffer + and change FP arg to an estream. Change all callers. + (print_utf8_string2): Ditto; new name is to print_utf8_buffer2. + +2010-03-11 Werner Koch + + * miscellaneous.c (print_string): Remove. + + * estream.c (es_setvbuf): Fix parameter check. + (es_set_buffering): Allow a SIZE of 0. + * asshelp.c (setup_libassuan_logging, my_libassuan_log_handler): New. + * logging.c (do_logv): Add arg IGNORE_ARG_PTR. Change all callers. + (log_string): New. + (log_flush): New. + (set_file_fd): Simplify by using estreams es_stderr. + + * estream.h (es_stdout, es_stderr, es_stdin): New. + +2010-03-10 Werner Koch + + * estream.c (es_func_fp_read, es_func_fp_write, es_func_fp_seek) + (es_func_fp_destroy): Allow a NULL FP to implement a dummy stream. + (do_fpopen): Ditto. + (es_vfprintf_unlocked): New. + (es_fprintf_unlocked): Make public. + (es_fputs_unlocked): New. + + * logging.h: Replace FILE* by estream_t. + * logging.c: Remove USE_FUNWRITER cpp conditional because we now + use estream. + (my_funopen_hook_ret_t, my_funopen_hook_size_t): Replace by + ssize_t. + (log_get_stream): Change to return an estream_t. + (set_file_fd): Always close the log stream because it can't be + assigned to stderr or stdout directly. Use a dummy estream as + last resort log stream. + (log_test_fd, log_get_fd): Use es_fileno. + (log_get_stream): Assert that we have a log stream. + (do_logv): Use estream functions and lock the output. + +2010-03-10 Werner Koch + + * util.h: Replace jnlib path part by common. + (snprintf): Use the replacement macro on all platforms. + + * Makefile.am (jnlib_sources): New. + (libcommon_a_SOURCES, libcommonpth_a_SOURCES): Add jnlib_sources. + (jnlib_tests): New. + (noinst_PROGRAMS, TESTS): Add jnlib_tests. + (t_common_ldadd): Remove libjnlib.a. + + * README.jnlib, ChangeLog.jnlib, libjnlib-config.h, argparse.c + * argparse.h, dotlock.c, dotlock.h, dynload.h, logging.c + * logging.h, mischelp.c, mischelp.h, stringhelp.c, stringhelp.h + * strlist.c, strlist.h, types.h, utf8conv.c, utf8conv.h + * w32-afunix.c, w32-afunix.h, w32-reg.c, w32help.h, xmalloc.c + * xmalloc.h, t-stringhelp.c, t-support.c, t-support.h + * t-timestuff.c, t-w32-reg.c: Move from jnlib to here. + + * init.c: Remove "estream.h". + * util.h: Include "estream.h". + + * xasprintf.c, ttyio.c: Remove "estream-printf.h". + +2010-03-08 Werner Koch + + * exechelp.c [!HAVE_SIGNAL_H]: Do not include signal.h. + (DETACHED_PROCESS, CREATE_NEW_PROCESS_GROUP) [W32CE]: Provide stubs. + + * iobuf.h (iobuf_ioctl_t): New. Use the new macros instead of the + hard wired values. + * iobuf.c (iobuf_append): Remove. + (iobuf_fdopen): Factor code out to ... + (do_iobuf_fdopen): ... new. + (iobuf_fdopen_nc): New. + (iobuf_open_fd_or_name): Implement using iobuf_fdopen_nc. + + * iobuf.c (INVALID_FD): Replace by GNUPG_INVALID_FD. + (fp_or_fd_t): Replace by gnupg_fd_t. + (my_fileno): Replace by the FD2INT macro. + (FILEP_OR_FD_FOR_STDIN, FILEP_OR_FD_FOR_STDOUT): Rename to + FD_FOR_STDIN, FD_FOR_STDOUT. + (file_filter): Make full use of FD_FOR_STDIN. + (USE_SETMODE): Remove. Not needed without stdio. + (my_fopen_ro, my_fopen): Replace unneeded macros. + + * iobuf.c [FILE_FILTER_USES_STDIO]: Remove all code. It has not + been used for a long time. + + * exechelp.h: Include "estream.h". + + * exechelp.c (gnupg_spawn_process): Change OUTFILE to an estream_t. + +2010-03-02 Werner Koch + + * estream.c, estream.h, estream-printf.c, estream-printf.h: Update + from libestream. + +2010-03-01 Werner Koch + + * signal.c [!HAVE_SIGNAL_H]: Don't include signal.h. + + * iobuf.c (direct_open) [W32CE]: Make filename to wchar_t. + (iobuf_cancel) [W32CE]: Use DeleteFile. + + * gettime.c (dump_isotime): Use "%s" to print "none". + + * homedir.c (standard_homedir) [W32CE]: Use wchar_t to create the + directory. + (w32_rootdir) [W32CE]: Likewise. + + * sysutils.c (translate_sys2libc_fd) [W32CE]: Add support. + (gnupg_tmpfile) [W32CE]: Ditto. + (_gnupg_getenv) [W32CE]: New. + + * util.h (getpid, getenv) [W32CE]: New. + + * i18n.c (i18n_switchto_utf8) + (i18n_switchback) [USE_SIMPLE_GETTEXT]: Use new function from + libgpg-error which supports proper restoring. + + * sysutils.c (get_session_marker): Simplified by using gcrypt. + +2009-12-08 Marcus Brinkmann + + * Makefile.am (audit-events.h, status.h) [!MAINTAINER_MODE]: No + longer include these rules if not in maintainer mode. + +2009-12-08 Werner Koch + + * userids.h, userids.c: New. + (classify_user_id): Merged from similar fucntions in sm/ and g10/. + + * dns-cert.c (get_dns_cert): Add support for ADNS. + +2009-12-08 Marcus Brinkmann + + * asshelp.c (start_new_gpg_agent): Convert posix FD to assuan FD. + + * asshelp.c (start_new_gpg_agent) [HAVE_W32_SYSTEM]: Add missing + argument in assuan_socket_connect invocation. + * iobuf.c (iobuf_open_fd_or_name): Fix type of FD in function + declaration. + +2009-12-07 Werner Koch + + * pka.c (get_pka_info): Add support for ADNS. + * src.v (getsrv): Add support for ADNS. + + * srv.c (getsrv): s/xrealloc/xtryrealloc/. + +2009-12-04 Werner Koch + + * Makefile.am (audit-events.h, status-codes.h): Create files in + the source dir. Fixes bug#1164. + +2009-12-02 Werner Koch + + * audit.c (proc_type_decrypt, proc_type_sign): Implemented. + (proc_type_verify): Print hash algo infos. + * audit.h (AUDIT_DATA_CIPHER_ALGO, AUDIT_BAD_DATA_CIPHER_ALSO) + (AUDIT_NEW_RECP, AUDIT_DECRYPTION_RESULT, AUDIT_RECP_RESULT) + (AUDIT_ATTR_HASH_ALGO, AUDIT_SIGNED_BY, AUDIT_SIGNING_DONE): + +2009-11-05 Marcus Brinkmann + + * asshelp.c (start_new_gpg_agent): Update use of + assuan_socket_connect and assuan_pipe_connect. + +2009-11-02 Marcus Brinkmann + + * get-passphrase.c (default_inq_cb, membuf_data_cb): Change return + type to gpg_error_t. + +2009-10-28 Werner Koch + + * status.h (STATUS_MOUNTPOINT): New. + +2009-10-16 Marcus Brinkmann + + * Makefile.am (libcommon_a_CFLAGS): Use LIBASSUAN_CFLAGS instead + of LIBASSUAN_PTH_CFLAGS. + +2009-10-13 Werner Koch + + * exechelp.c (gnupg_kill_process): New. + +2009-09-29 Werner Koch + + * exechelp.c (create_inheritable_pipe): Rename to + create_inheritable_pipe_w. + (create_inheritable_pipe_r): New. + (gnupg_create_outbound_pipe): New. + + * iobuf.h: Include "sysutils.h" + + * iobuf.c (iobuf_open_fd_or_name): New. + (iobuf_get_fname_nonnull): New. + +2009-09-23 Marcus Brinkmann + + * asshelp.c (start_new_gpg_agent): Allocate assuan context before + starting server. + +2009-09-03 Werner Koch + + Update from libestream: + * estream-printf.c: Include stdint.h only if HAVE_STDINT_H is + defined. + * estream-printf.c: Remove all test code. Use macro DEBUG instead + of TEST for debugging. + * estream-printf.c (pr_float): Make buffer larger for silly high + numbers. + +2009-08-11 David Shaw + + * ttyio.h, ttyio.c (tty_enable_completion): Some ifdefs around + HAVE_LIBREADLINE to allow building when readline isn't available. + +2009-08-06 Werner Koch + + * status.h (STATUS_INV_SGNR, STATUS_NO_SGNR): New. + * status.c (get_inv_recpsgnr_code): New. + +2009-07-23 David Shaw + + * srv.c (getsrv): Fix type-punning warning. + +2009-07-23 Werner Koch + + * util.h (GPG_ERR_NOT_ENABLED): New. + * audit.h (enum): Add AUDIT_CRL_CHECK. + * audit.c (proc_type_verify): Show CRL check result. + +2009-07-06 Werner Koch + + * get-passphrase.c (struct agentargs): Add SESSION_ENV and remove + obsolete args. + (gnupg_prepare_get_passphrase): Ditto. + + * session-env.c, session-env.h: New. + * t-session-env.c: New. + * Makefile.am (common_sources, module_tests): Add them. + * asshelp.h: Include "session-env.h" + * asshelp.c (send_one_option): Add arg PUTENV. + (send_pinentry_environment): Replace most args by SESSION_ENV and + rewrite fucntion. + (start_new_gpg_agent): Likewise. + + * t-exechelp.c (test_close_all_fds): Remove debug code. + +2009-07-01 Werner Koch + + * sexputil.c (get_pk_algo_from_canon_sexp): New. + +2009-06-29 Werner Koch + + * estream.c (BUFFER_ROUND_TO_BLOCK): Remove unused macro. + (es_func_mem_write): Rewrite reallocation part. + + * estream.c (es_write_sanitized_utf8_buffer): Typo typo fix. + +2009-06-25 Werner Koch + + * estream.c (es_write_sanitized_utf8_buffer): Typo fix. + +2009-06-24 Werner Koch + + * estream.c (es_read_line): In the malloc error case, set + MAX_LENGTH to 0 only if requested. + * xreadline.c (read_line): Ditto. + * estream.c (es_write_sanitized_utf8_buffer): Pass on error from + es_fputs. + * sexputil.c (get_rsa_pk_from_canon_sexp): Check for error after + the loop. Reported by Fabian Keil. + +2009-06-22 Werner Koch + + * estream.c (es_pth_read, es_pth_write) [W32]: New. + (ESTREAM_SYS_READ, ESTREAM_SYS_WRITE) [HAVE_PTH]: Use them. + +2009-06-03 Werner Koch + + * estream.c (es_convert_mode): Rewrite and support the "x" flag. + +2009-05-28 David Shaw + + From 1.4: + + * http.h, http.c (send_request) Pass in a STRLIST for additional + headers. Change all callers. + +2009-05-27 David Shaw + + From 1.4: + + * http.h, http.c (send_request): Pass in srvtag and make its + presence sufficient to turn the feature on. + (http_open): From here. + (http_document): And here. + + * srv.c (getsrv): Raise maximum packet size to 2048, as PACKETSZ + is too small these days. + +2009-05-22 Werner Koch + + * ttyio.c (tty_cleanup_after_signal): New. + +2009-05-19 Werner Koch + + * simple-pwquery.c (agent_open): Use SUN_LEN + (JNLIB_NEED_AFLOCAL): Define and include mischelp.h. + +2009-05-07 Werner Koch + + * sexputil.c (get_rsa_pk_from_canon_sexp): New. + * t-sexputil.c (test_make_canon_sexp_from_rsa_pk): Extend the test. + +2009-04-28 Werner Koch + + * sexputil.c (make_canon_sexp_from_rsa_pk): New. + * t-sexputil.c (test_make_canon_sexp_from_rsa_pk): New. + +2009-04-01 Werner Koch + + * iobuf.c: Port David's changes from 1.4: + (fd_cache_invalidate): Pass return code from close back. + (direct_open, iobuf_ioctl): Check that return value. + (fd_cache_synchronize): New. + (iobuf_ioctl): Add new sub command 4 (fsync). + + * iobuf.c (fd_cache_strcmp): New. Taken from 1.4. + (fd_cache_invalidate, fd_cache_close, fd_cache_open): Use it. + + * exechelp.c (gnupg_spawn_process): Implement new flag bit 6. + * sysutils.c (gnupg_allow_set_foregound_window): Allow the use of + ASFW_ANY. + + * membuf.c (put_membuf, get_membuf): Wipe memory on out of core. + +2009-03-31 Werner Koch + + * percent.c (percent_unescape, percent_plus_unescape): New. + (percent_plus_unescape_inplace, percent_unescape_inplace): New. + (do_plus_or_plain_unescape, count_unescape, do_unescape): New. + (do_unescape_inplace): New. + * t-percent.c (test_percent_plus_escape): Test percent_plus_unescape. + + * get-passphrase.c, get-passphrase.h: New. + * Makefile.am (without_pth_sources): New. + +2009-03-18 Werner Koch + + * exechelp.c: Include sys/resource.h and sys/stat.h. + (get_max_open_fds): New. + (do_exec): Use it. + (get_all_open_fds): New. + (close_all_fds): New. + (do_exec): Use close_all_fds. + * t-exechelp.c: New. + +2009-03-13 David Shaw + + * http.c (do_parse_uri): Properly handle IPv6 literal addresses as + per RFC-2732. Adapted from patch by Phil Pennock. + +2009-03-12 Werner Koch + + * gettime.c: Include i18n.h. + (dump_isotime): New. + +2009-03-06 Werner Koch + + * sexputil.c (make_canon_sexp): New. + +2009-03-03 Werner Koch + + * exechelp.c (do_exec): Make sure that /dev/null connected FDs are + not closed. + +2009-01-19 Werner Koch + + * audit.c (writeout_li): Translate a few more result strings. + Fixes bug#970. + + * convert.c (hex2str): Fix optimization to append a nul character. + +2008-12-05 Werner Koch + + * percent.c, t-percent.c: New. + + * exechelp.c (gnupg_spawn_process, gnupg_spawn_process_fd) + (gnupg_spawn_process_detached) [W32]: Remove debug output. + +2008-11-20 Werner Koch + + * audit.c (writeout_li): Translate OKTEXT. + +2008-11-04 Werner Koch + + * i18n.c (i18n_init) [USE_SIMPLE_GETTEXT]: Adjust for changed + w32-gettext.c. + * homedir.c (gnupg_localedir): New. + +2008-10-20 Werner Koch + + * http.c (http_register_tls_callback) [!HTTP_USE_GNUTLS]: Mark + unused arg. + * localename.c (do_nl_locale_name): Ditto. + * audit.c (event2str): Silent gcc warning. + * sysutils.c (translate_sys2libc_fd): Mark unused arg. + (translate_sys2libc_fd_int): Ditto. + * iobuf.c (translate_file_handle): Ditto. + * asshelp.c (send_one_option): Ditto. + * exechelp.c (gnupg_spawn_process): Ditto. + * signal.c (got_usr_signal): Ditto + * estream.c (es_func_fd_create) [!W32]: Ditto. + (es_func_fp_create) [!W32]: Ditto. + (es_write_hexstring): Ditto. + (dummy_mutex_call_void, dummy_mutex_call_int) [HAVE_PTH]: New. + (ESTREAM_MUTEX_LOCK, ESTREAM_MUTEX_UNLOCK, ESTREAM_MUTEX_TRYLOCK) + (ESTREAM_MUTEX_INITIALIZE) [HAVE_PTH]: Use dummy calls so to mark + unused arg. + +2008-10-19 Werner Koch + + * estream-printf.c (estream_vsnprintf): Fix return value. + (check_snprintf): Add a new test. + (one_test) [W32]: Disable test. + +2008-10-17 Werner Koch + + * util.h (snprintf) [W32]: Redefine to estream_snprintf. + +2008-09-03 Werner Koch + + * convert.c (hex2str): New. + (hex2str_alloc): New. + * t-convert.c (test_hex2str): New. + +2008-08-19 Werner Koch + + * iobuf.c: Avoid passing a NULL (iobuf_t)->desc to the log + function. Should in general never be NULL, but well. Reported by + M. Heneka. + +2008-06-26 Werner Koch + + * estream.c (es_write_sanitized): Loose check for control + characters to better cope with utf-8. The range 0x80..0x9f is + nowadays not anymore accidently used for control charaters. + +2008-06-25 Marcus Brinkmann + + Revert last three changes related to handle translation. + * sysutils.c: + (FD_TRANSLATE_MAX, fd_translate, fd_translate_len) + (translate_table_init, translate_table_lookup): Removed. + * iobuf.c (check_special_filename): Do not use + translate_table_lookup. + * sysutils.h (translate_table_init, translate_table_lookup): + Remove prototypes. + +2008-06-19 Werner Koch + + * sysutils.c: Remove . + (fd_translate_max): Use macro for the size. + (translate_table_init): Protect read against EINTR and replace + isspace by spacep. + +2008-06-18 Marcus Brinkmann + + * sysutils.c (TRANS_MAX): Bump up to 350 to be on the safe side. + + * sysutils.h (translate_table_init, translate_table_lookup): New + prototypes. + * sysutils.c: Include . + (FD_TRANSLATE_MAX): New macro. + (fd_translate, fd_translate_len): New static variables. + (translate_table_init, translate_table_lookup): New functions. + (translate_sys2libc_fd_int): Translate file descriptor. + * iobuf.c (check_special_filename): Translate handle values from + special filenames. + +2008-06-16 Werner Koch + + * homedir.c (w32_commondir): New. + (gnupg_sysconfdir): Use it. + +2008-06-09 Werner Koch + + * b64dec.c: New. + +2008-06-05 Werner Koch + + * util.h (gnupg_copy_time): Replace strcpy by memcpy. + +2008-05-26 Werner Koch + + * asshelp.c (send_one_option, send_pinentry_environment): use + xfree and xtrystrdup. + + * i18n.c (i18n_switchto_utf8) [USE_SIMPLE_GETTEXT]: Return NULL. + + * homedir.c (gnupg_module_name): Add + GNUPG_MODULE_NAME_CONNECT_AGENT and GNUPG_MODULE_NAME_GPGCONF. + +2008-04-21 Werner Koch + + * http.c (http_wait_response) [W32]: Use DuplicateHandle because + it is a socket. + (cookie_read) [W32]: Use recv in place of read. + +2008-04-08 Werner Koch + + * i18n.c (i18n_switchto_utf8, i18n_switchback) + [USE_SIMPLE_GETTEXT]: Implement. + +2008-04-07 Werner Koch + + * b64enc.c (b64enc_start): Detect PGP mode. + (b64enc_finish): Write PGP CRC. + * util.h (struct b64state): Add field CRC. + * t-b64.c: New. + + * pka.c (get_pka_info): Use xtrymalloc and check result. + +2008-03-25 Werner Koch + + * localename.c: Strip all W32 code. Include w32help.h. + (gnupg_messages_locale_name) [W32]: Use the gettext_localename. + +2008-03-17 Werner Koch + + * iobuf.c (IOBUF_BUFFER_SIZE): Actually use this macro. + + * simple-pwquery.c (agent_send_all_options): Fix last change. + +2008-03-06 Werner Koch + + * simple-pwquery.c (agent_send_all_options): Add support for + XAUTHORITY and PINENTRY_USER_DATA. + +2008-02-15 Marcus Brinkmann + + * exechelp.c (gnupg_spawn_process_fd): Add flag DETACHED_PROCESS + unconditionally (required for all callers at the moment). + +2008-02-14 Werner Koch + + * sysutils.c (gnupg_allow_set_foregound_window): New. + (WINVER) [W32]: Define. + +2008-01-31 Werner Koch + + * audit.c (audit_print_result): Make sure that the output is + always UTF8. + +2008-01-27 Werner Koch + + * exechelp.c (gnupg_spawn_process): Add arg FLAGS and changed all + callers to pass 0 for it. + +2007-12-13 Werner Koch + + * sexputil.c (hash_algo_from_sigval): New. + * t-sexputil.c: New. + * Makefile.am (module_tests): Add it. + +2007-12-11 Werner Koch + + * asshelp.c (send_pinentry_environment): Allow using of old + gpg-agents not capabale of the xauthority and pinentry_user_data + options. + +2007-12-04 Werner Koch + + * Makefile.am (t_helpfile_LDADD, module_maint_tests): New. + * t-helpfile.c: New. + * helpfile.c: New. + * membuf.h (is_membuf_ready, MEMBUF_ZERO): New. + * localename.c: New. Taken from gettext with modifications as done + for GpgOL. Export one new function. + * util.h (gnupg_messages_locale_name, gnupg_get_help_string): Added. + + * sysutils.c (gnupg_reopen_std): New. Taken from ../g10/gpg.c. + +2007-11-27 Werner Koch + + * Makefile.am (CLEANFILES): New. + + * homedir.c (dirmngr_socket_name): Use CSIDL_WINDOWS. + +2007-11-15 Werner Koch + + * asshelp.c (send_pinentry_environment): Add args XAUTHORITY and + PINENTRY_USER_DATA. + (start_new_gpg_agent): Ditto. + +2007-11-07 Werner Koch + + * status.h: New. + * errors.h: Remove. + +2007-11-05 Werner Koch + + * audit.c, audit.h: New. + * Makefile.am: Add rules to build audit-events.h. + * exaudit.awk: New. + * mkstrtable.awk: New. Taken from libgpg-error. + +2007-10-19 Werner Koch + + * i18n.c (i18n_switchto_utf8, i18n_switchback): New. + +2007-10-01 Werner Koch + + * sysutils.h (FD2INT, INT2FD): New. + +2007-09-21 Werner Koch + + * homedir.c (default_homedir): Make registry work. Reported by + Marc Mutz. + +2007-08-29 Werner Koch + + * exechelp.c (gnupg_wait_process): Add arg EXITCODE. Changed all + callers. + (gnupg_create_inbound_pipe): New. + * util.h (GNUPG_MODULE_NAME_GPGSM, GNUPG_MODULE_NAME_GPG): New. + * homedir.c (gnupg_module_name): Add them + +2007-08-28 Werner Koch + + * gettime.c (check_isotime, add_isotime): New. Originally written + for DirMngr by me. + (add_days_to_isotime): New. + (date2jd, jd2date, days_per_month, days_per_year): New. Taken from + my ancient (1988) code used in Wedit (time2.c). + +2007-08-27 Werner Koch + + * util.h (GNUPG_MODULE_NAME_CHECK_PATTERN): New. + * homedir.c (gnupg_module_name): Add it. + * exechelp.c (w32_fd_or_null) [W32]: New. + (gnupg_spawn_process_fd): New. + (gnupg_wait_process) [W32]: Close the handle after if the process has + returned. + +2007-08-22 Werner Koch + + Updated estream from libestream. + + * estream.c (mem_malloc, mem_realloc, mem_free): New. Use them + instead of the ES_MEM_foo. + * estream.c (estream_cookie_mem): Remove members DONT_FREE, + APPEND_ZERO, PTR and SIZE. Add MEMORY_LIMIT. Put GROW into a new + FLAGS struct. + (es_func_mem_create): Remove APPEND_ZERO, DONT_FREE, PTR and + SIZE. Add MEMORY_LIMIT. + (es_func_mem_write, es_func_mem_seek, es_func_mem_destroy): Revamp. + (es_open_memstream): Change API to just take a memory limit and a + mode argument. Rename to .. + (es_fopenmem): .. this. + (HAVE_W32_SYSTEM) [_WIN32]: Define if not defined. + (tmpfd) [W32]: Implement directly using the W32 API. + (es_fgets): Rewrite without using doreadline. + +2007-08-21 Werner Koch + + * sysutils.c (gnupg_tmpfile): New. + * t-sysutils.c: New. + * Makefile.am (module_tests): Add t-sysutils. + +2007-08-20 Werner Koch + + * exechelp.c [W32]: Redefine X_OK to F_OK. + +2007-08-16 Werner Koch + + * Makefile.am (t_convert_DEPENDENCIES): Remove + ($(PROGRAMS)): Remove. + (t_common_ldadd): Use libcommon.a and not the macro. + +2007-08-14 Werner Koch + + * homedir.c (dirmngr_socket_name): New. + +2007-08-07 Werner Koch + + * tlv.c, tlv.h: Move from ../scd/. + * tlv.c (parse_sexp, parse_ber_header): Add ERRSOURCE arg and prefix + name with a _. + * tlv.h: Use macro to convey ERRSOURCE. + +2007-08-02 Werner Koch + + * gc-opt-flags.h: New. + +2007-08-01 Werner Koch + + * estream-printf.c (read_dummy_value): Removed as it is useless now. + (read_values): Remove check on !vaargs which is not anymore needed + and anyway not portable. Reported by Peter O'Gorman. + +2007-07-16 Werner Koch + + * estream.c (es_func_file_create): Clear NO_CLOSE flag. + +2007-07-12 Werner Koch + + * sysutils.h (gnupg_fd_t): New. + * sysutils.c (translate_sys2libc_fd): Use that type instead of int. + (translate_sys2libc_fd_int): New. + +2007-07-09 Werner Koch + + * t-gettime.c (test_isotime2epoch): Use time_t and not u32. + +2007-07-05 Werner Koch + + * t-gettime.c: New. + * gettime.c (isotime2epoch, epoch2isotime): New. + +2007-07-04 Werner Koch + + * estream.c (es_init_do): Do not throw an error if pth has already + been initialized. + +2007-06-26 Werner Koch + + * Makefile.am ($(PROGRAMS)): New. + + * util.h (init_common_subsystems): Moved to .. + * init.h: .. New. + * util.h: Include init.h. + + * homedir.c (standard_homedir): New. + (default_homedir) [W32]: Reimplemented in terms of + standard_homedir. Fixed memory leak. + +2007-06-25 Werner Koch + + * iobuf.c: Add more documentation and slighly restructured macro + defintion for better readability. + (FILEP_OR_FD): Rename to fp_or_fd_t. + (CLOSE_CACHE): Rename to close_cache_t. + + * sysutils.c (translate_sys2libc_fd): New using the code from iobuf.c. + * iobuf.c: Include sysutils.h. + (iobuf_translate_file_handle): Remove. + (translate_file_handle): Use new function. + + * estream-printf.c [TEST]: Header including fixes. + (do_format): Do not append a trailing Nul. This avoids spurious + Nuls in the es_printf output. + (estream_vsnprintf, estream_vasprintf): Take this in account. + + * estream.h (struct es__stream): Change FLAGS to a bit structure. + (ES__FLAG_WRITING): Replace by a bit from FLAGS. * estream.c + (struct estream_internal): Rename FLAGS to MODEFLAGS so that they + are not confused with the estream flags. + (es_initialize, es_create): Add arg MODEFLAGS so that we can setup + the intial writemode. Changed all callers to pass them. + (es_convert_mode): Set O_BINARY. + (es_func_fd_create, es_func_fp_create, es_func_file_create) [W32]: + Call setmode if requested. + +2007-06-24 Werner Koch + + * estream.c (do_fpopen, es_fpopen, es_fpopen_nc): New. + (es_func_fp_create, es_func_fp_read, es_func_fp_write) + (es_func_fp_seek, es_func_fp_destroy): New. + +2007-06-22 Werner Koch + + * estream.c (es_fdopen): Factored code out to.. + (do_fdopen): .. new. + (es_fdopen_nc): New. + (estream_cookie_fd): Add field NO_CLOSE. + (es_func_fd_create): Add arg NO_CLOSE and changed all callers. + (es_func_fd_destroy): Handle the new flag. + + * homedir.c (gnupg_libexecdir) [W32]: Factor code out to .. + (w32_rootdir): .. new. + (gnupg_sysconfdir, gnupg_libdir, gnupg_datadir) [W32]: Return + name based on w32_rootdir(). + +2007-06-21 Werner Koch + + * membuf.h (get_membuf_len): New. + + * membuf.c (init_membuf_secure): Really allocate in secure memory. + (put_membuf_str): New. + + * ttyio.c (tty_getf): New. + + * util.h (ctrl_t): Declare it here. + + * asshelp.c (start_new_gpg_agent): New. Based on code from + ../sm/call-agent.c + +2007-06-20 Werner Koch + + * sysutils.c (gnupg_sleep): New. + * sysutils.h [W32]: Remove _sleep wrapper. Changed all callers to + use gnupg_sleep. + + * exechelp.c (build_w32_commandline_copy): New. + (build_w32_commandline): Factored some code out to new function + and correctly process a PGMNAME with spaces. + (gnupg_spawn_process_detached) [W32]: Implement. + +2007-06-14 Werner Koch + + * simple-pwquery.h (MAP_SPWQ_ERROR_IMPL): New. + (SPWQ_NO_PIN_ENTRY): New. + * simple-pwquery.c (simple_pw_set_socket): New. + (agent_open): Use it if GPG_AGENT_INFO is not set. + (simple_pwquery): Extended to allow returning of otehyr error codes. + + * util.h (GNUPG_MODULE_NAME_AGENT, GNUPG_MODULE_NAME_PINENTRY) + (GNUPG_MODULE_NAME_SCDAEMON, GNUPG_MODULE_NAME_DIRMNGR) + (GNUPG_MODULE_NAME_PROTECT_TOOL): New. + * homedir.c (gnupg_module_name): New. + (gnupg_bindir): New. + +2007-06-12 Werner Koch + + * homedir.c (gnupg_sysconfdir): New. + (gnupg_libexecdir): New. Taken from g10/misc.c:get_libexecdir. + (gnupg_datadir): New. + (gnupg_libdir): New. + + * http.c (connect_server) [W32]: Do not call init_sockets if + HTTP_NO_WSASTARTUP is defined. + + * init.c: New. + + * estream.c (es_init_do): Init stream lock here because we can't + use a static initialization with W32pth. + +2007-06-11 Werner Koch + + * Makefile.am (t_common_ldadd): Use libcommonstd macro. + +2007-06-06 Werner Koch + + * Makefile.am: Include am/cmacros.am. + + * sysutils.h [W32]: Remove prototypes for the registry access. + * w32reg.c: Move to ../jnlib/w32-reg.c. + + * i18n.c (i18n_init): New. + + * simple-gettext.c: Remove. + + * iobuf.c (iobuf_get_filelength): Rename SIZE to EXSIZE to silent + shadowing warning. + +2007-06-04 Werner Koch + + * http.c [W32]: Include unistd.h also in this case. + (write_server) [W32]: Fixed error code. + (init_sockets): Fixed syntax error. + (cookie_close): Replace close by sock_close macro. + + * estream.c [w32]: Do not init Mutex. + + * Makefile.am (common_sources) [USE_SNS_SRV]: Build srv.c only + when needed. + + * ttyio.c (init_ttyfp) [W32]: Do not use TTYFP. + + * util.h: Include ../jnlib/dynload.h. + + * dynload.h: Move to ../jnlib. + +2007-05-30 Werner Koch + + * estream.c (MEM_FREE, MEM_ALLOC, MEM_REALLOC): Prefix with ES_ as + windows.h also has such definitions, + +2007-05-15 Werner Koch + + * util.h: Do not include gnulib's vasprintf. Redefine asprintf + and vasprintf. + + * xasprintf.c (xasprintf, xtryasprintf): Use estream_vasprintf. + + * estream-printf.h, estream-printf.c: New. Taken from current + libestream SVN. + * Makefile.am (common_sources): Add them. + +2007-05-14 Werner Koch + + * sexp-parse.h (smklen): New. + * sexputil.c: Include sexp-parse.h. + (make_simple_sexp_from_hexstr): Replace sprintf by smklen. + +2007-05-07 Werner Koch + + * signal.c (got_fatal_signal): Protect SIG from being clobbered by + a faulty signal implementaion. Suggested by James Juran. + +2007-04-25 Werner Koch + + * i18n.h (ngettext): New. + * simple-gettext.c (ngettext): New. + +2007-04-20 Werner Koch + + * miscellaneous.c (my_gcry_logger, my_gcry_outofcore_handler): + Moved from gpg-agent to here. + (my_gcry_fatalerror_handler): new. + (setup_libgcrypt_logging): New. + +2007-03-19 Werner Koch + + * miscellaneous.c (print_hexstring): New. + * estream.c (es_fprintf_unlocked): New. + (es_write_sanitized): New. + (es_write_hexstring): New. + (es_write_sanitized_utf8_buffer) [GNUPG_MAJOR_VERSION]: New. + +2007-03-09 David Shaw + + From STABLE-BRANCH-1-4 + + * http.c (do_parse_uri): Remove the hkp port 11371 detection. We + implement hkp in the keyserver handler, and the support here makes + it appear like a bad hkp request actually succeeded. + +2007-01-31 Werner Koch + + * Makefile.am (t_common_ldadd): Add LIBINCONV and LIBINTL. + +2007-01-25 Werner Koch + + * simple-pwquery.c (simple_pwquery): New arg OPT_CHECK. + +2006-12-13 David Shaw + + * Makefile.am (AM_CPPFLAGS): Include intl/ so we can reference the + built-in headers. + +2006-11-23 Werner Koch + + * http.c: Include i18n.h + +2006-11-21 Werner Koch + + * estream.c: Remove explicit Pth soft mapping diabling becuase it + is now done in config.h. + +2006-11-15 Werner Koch + + * estream.c: Disabled Pth soft mapping. + (my_funopen_hook_ret_t): New. + (print_fun_writer): Use it here. + + * iobuf.c (fd_cache_close): Use %d instead of %p for debug output. + +2006-11-03 Werner Koch + + * Makefile.am (t_convert_DEPENDENCIES): Add libcommon. From + Gentoo. + +2006-10-24 Marcus Brinkmann + + * Makefile.am (libcommon_a_CFLAGS): Add $(LIBASSUAN_CFLAGS). + (libsimple_pwquery_a_CFLAGS): New variable. + +2006-10-20 Werner Koch + + * convert.c (hex2bin): New. + +2006-10-17 Werner Koch + + * estream.c (struct estream_internal, es_initialize) + (es_deinitialize, print_fun_writer, es_print): New and modified + functions to avoid tempfiles for printf style printing. + + * Makefile.am (libcommonpth_a_SOURCES): New. We now build a secon + version of the library with explicit Pth support. + * exechelp.c, estream.c: Make use of WITHOUT_GNU_PTH. + +2006-10-08 Werner Koch + + * gpgrlhelp.c: Trun all functions into dummies if readline is not + available. + +2006-10-06 Werner Koch + + * Makefile.am (AM_CFLAGS): Use PTH version of libassuan. + + * util.h (GNUPG_GCC_A_SENTINEL): Defined for gcc >= 4. + +2006-10-04 David Shaw + + * gpgrlhelp.c: readline requires stdio.h. + +2006-10-04 Werner Koch + + * membuf.c (init_membuf_secure): New. + (put_membuf): Make sure that ERRNO is set even if the underlying + malloc code does not work properly. + (get_membuf): Set ERRNO on error. + (get_membuf): Allow to pass LEN as NULL. + +2006-10-02 Werner Koch + + * iobuf.c (iobuf_unread): Removed. This code is not required. + Also removed the entire unget buffer stuff. + +2006-09-27 Werner Koch + + * util.h: Do not include strsep.h and strpbrk.h. + (isascii): Removed as it is now in jnlib. + + * iobuf.c (pop_filter, underflow, iobuf_close): Free the unget + buffer. + +2006-09-27 Florian Weimer (wk) + + * iobuf.c (iobuf_unread): New. + +2006-09-22 Werner Koch + + * i18n.h: Changed license to an all permissive one. + + * ttyio.c (tty_get): We need to use readline too. Added two more + hooks. + +2006-09-21 Werner Koch + + * ttyio.c (tty_private_set_rl_hooks): New. + (tty_enable_completion, tty_disable_completion): Use a hook to + enable readline support. Now always available. + (tty_cleanup_rl_after_signal): New. + + * ttyio.h: Removed readline specific stuff. Included util.h. + * common-defs.h: New. + +2006-09-15 Werner Koch + + * convert.c: New. + (hexcolon2bin): New. + (bin2hex, bin2hexcolon, do_binhex): New. + * t-convert.c: New + +2006-09-14 Werner Koch + + * util.h (out_of_core): Use new gpg_error_from_syserror function. + + * http.c (init_sockets): Changed it to require 2.2 unless it is + build within gnupg 1 where we require 1.1 (and not anymore allow + for 1.0). + +2006-09-07 Werner Koch + + * exechelp.c (gnupg_spawn_process): Factor out post fork code to .. + (do_exec): .. new function. Allow passing of -1 for the fds. + (gnupg_spawn_process): Terminate gcrypt's secure memory in the child. + (gnupg_spawn_process_detached): New. + +2006-09-06 Werner Koch + + * maperror.c: Removed. + + * util.h (out_of_core): New. + +2006-09-04 Werner Koch + + * http.c (http_get_header): New. + (capitalize_header_name, store_header): New. + (parse_response): Store headers away. + (send_request): Return GPG_ERR_NOT_FOUND if connect_server failed. + * http.h: New flag HTTP_FLAG_NEED_HEADER. + +2006-08-21 Werner Koch + + * Makefile.am (libcommon_a_SOURCES): Added keyserver.h + + * openpgpdefs.h: New. Stripped from ..g10/packet.h. + +2006-08-16 Werner Koch + + * keyserver.h: Moved from ../include to here. + + * http.c: Include srv.h. + + * srv.c, srv.h: New. Taken from GnuPG 1.4 + +2006-08-14 Werner Koch + + * http.h (struct http_context_s): Moved to implementation. + * http.c (http_open): Changed call to return a context. + (http_open_document): Ditto. + (http_get_read_ptr, http_get_read_ptr, http_get_status_code): New. + (do_parse_uri): Replaced strlwr by straight code to ease + standalone use of this file. + (http_wait_response): Removed arg STATUS_CODE as it is available + through an accessor function. Adjusted caller. + (http_escape_string): New. + + * estream.c (es_read_line): Renamed to .. + (doreadline): .. this. Changed all callers. + (es_read_line): New. This is theusual limited getline variabnt as + used at several places. Here taken and adjusted from xreadline.c + (es_free): New. + +2006-08-11 Werner Koch + + * http.c: Major internal changes to optionallly support GNUTLS and + ESTREAM. + (http_open): Move initialization of the stream ... + (send_request): .. here. + (http_register_tls_callback): New. + + * estream.c (es_writen): Try to seek only is a seek function has + been registered. + +2006-08-09 Werner Koch + + * http.c, http.h: New. Taken from gnupg 1.4.5, merged with + changes done for the Dirmngr project (by g10 Code) and cleaned up + some stuff. + (make_header_line): New. Change all caller to make user of the new + * Makefile.am (libcommon_a_SOURCES): Added http.c and http.h. + +2006-05-23 Werner Koch + + * gettime.c (isotimestamp): New. + + * ttyio.c (tty_get_ttyname): Posixly correct usage of ctermid. + + * dns-cert.c: New. Taken from 1.4.3's util/cert.c. + * dns-cert.h: New. + +2006-05-22 Werner Koch + + * pka.c: New. Taked from 1.4.3. + * pka.h: New. + * Makefile.am: Added pka. + +2006-05-19 Werner Koch + + * yesno.c (answer_is_yes_no_default, answer_is_yes_no_quit): + Updated from 1.4.3. + (answer_is_okay_cancel): new. From 1.4.3. + + * miscellaneous.c (match_multistr): New. Taken from 1.4.3. + + * ttyio.c (tty_enable_completion, tty_disable_completion): New + dummy functions. + * ttyio.h: Add prototypes and stubs. + +2006-04-19 Werner Koch + + * iobuf.c (iobuf_get_fd): New. Taken from 1.4.3. + (iobuf_is_pipe_filename): New. + (pop_filter): Made static. + (iobuf_skip_rest): New. Orginal patch by Florian + Weimer. Added new argument PARTIAL. + (block_filter): Remove the old gpg indeterminate length mode. + (block_filter): Properly handle a partial body stream + that ends with a 5-byte length that happens to be zero. + (iobuf_set_block_mode, iobuf_in_block_mode): Removed as + superfluous. + (iobuf_get_filelength): New arg OVERFLOW. + (iobuf_get_filelength) [W32]: Use GetFileSizeEx if available + * miscellaneous.c (is_file_compressed): Take care of OVERFLOW. + +2006-04-18 Werner Koch + + * homedir.c (w32_shgetfolderpath): New. Taken from gpg 1.4.3. + (default_homedir): Use it. + +2005-10-08 Marcus Brinkmann + + * signal.c (get_signal_name): Check value of HAVE_DECL_SYS_SIGLIST + instead of just if it is defined. + +2005-09-28 Marcus Brinkmann + + * Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS). + +2005-07-04 Marcus Brinkmann + + * simple-pwquery.h (simple_pwclear): New prototype. + * simple-pwquery.c (simple_pwclear): New function. + +2005-06-15 Werner Koch + + * miscellaneous.c (make_printable_string): Made P a void*. + + * sexputil.c (keygrip_from_canon_sexp, cmp_simple_canon_sexp): + Fixed signed/unsigned pointer mismatch. + (make_simple_sexp_from_hexstr): Ditto. This is all too ugly; I + wonder why gcc-4's default is to warn about them and forcing us to + use cast the warning away. + * iobuf.c (block_filter): Ditto. + (iobuf_flush): Ditto. + (iobuf_read_line): Ditto. + (iobuf_read): Make BUFFER a void *. + (iobuf_write): Make BUFFER a const void *. + * ttyio.c (tty_print_utf8_string2): Ditto. + * estream.c (estream_cookie_mem): Make MEMORY unsigned char*. + (es_write): Make BUFFER a void *. + (es_writen): Ditto. + (es_func_fd_read, es_func_fd_write, es_func_mem_read) + (es_func_mem_write): Ditto. + (es_read, es_readn): Ditto. + (es_func_mem_write): Made MEMORY_NEW an unsigned char *. + * estream.h (es_cookie_read_function_t) + (es_cookie_write_function_t): Changed buffer arg to void*. + +2005-06-03 Werner Koch + + * estream.c: Use HAVE_CONFIG_H and not USE_CONFIG_H! + (es_func_fd_read, es_func_fd_write): Protect against EINTR. + +2005-06-01 Werner Koch + + * Makefile.am (AM_CPPFLAGS): Added. + + * util.h: Add some includes for gnulib. + (ttyname, isascii): Define them inline. + * fseeko.c, ftello.c: Removed. + * strsep.c, mkdtemp.c: Removed. + * ttyname.c, isascii.c: Removed. + +2005-05-31 Werner Koch + + * dynload.h: s/__inline__/inline/. + +2005-05-13 Werner Koch + + * signal.c (got_fatal_signal): Print the signal number if we can't + get a name for it. + (get_signal_name): Return NULL if no name is available. Fixed + conditional for sys_siglist to the correct one. + +2005-04-17 Werner Koch + + * sexputil.c (cmp_simple_canon_sexp): New. + (make_simple_sexp_from_hexstr): New. + +2005-04-07 Werner Koch + + * sexputil.c: New. + +2005-04-11 Marcus Brinkmann + + * simple-pwquery.c (simple_pwquery): Use spwq_secure_free. + +2005-03-03 Werner Koch + + * Makefile.am (AM_CFLAGS): Added PTH_CFLAGS. Noted by Kazu Yamamoto. + +2005-02-25 Werner Koch + + * xasprintf.c (xtryasprintf): New. + +2005-01-26 Moritz Schulte + + * Makefile.am (libcommon_a_SOURCES): New source files: estream.c, + estream.h. + * estream.c, estream.h: New files. + +2005-01-03 Werner Koch + + * asshelp.c (send_pinentry_environment): Fixed changed from + 2004-12-18; cut+paste error for lc-messages. + +2004-12-21 Werner Koch + + * simple-pwquery.c (agent_open) [W32]: Implement for W32. + (readline) [W32]: Use recv instead of read. + (writen) [W32]: Use send instead of write. + (my_stpcpy): Define a stpcpy replacement so that this file + continues to be self-contained. + (agent_send_all_options) [W32]: Don't call ttyname. + +2004-12-21 Marcus Brinkmann + + * simple-pwquery.h (simple_query): Add prototype. + * simple-pwquery.c (simple_query): New function. + +2004-12-21 Werner Koch + + * signal.c (got_fatal_signal, got_usr_signal) + (got_fatal_signal) [DOSISH]: Don't build. + * simple-gettext.c: Include sysutils.h + + * homedir.c: New. Use CSIDL_APPDATA for W32 as the default home + directory. + * Makefile.am (libcommon_a_SOURCES): Add it. + (EXTRA_DIST): Removed mkerror and mkerrtok. + +2004-12-20 Werner Koch + + * sysutils.h [W32]: Define sleep. + * util.h: Add prototype for mkdtemp. + + * membuf.c (put_membuf): Wipe out buffer after a failed realloc. + +2004-12-19 Werner Koch + + * maperror.c (map_assuan_err_with_source): Oops, args were swapped. + +2004-12-18 Werner Koch + + * maperror.c (map_assuan_err): Renamed to .. + (map_assuan_err_with_source): .. this and add arg SOURCE.c + * asshelp.c (send_pinentry_environment, send_one_option): Add arg + ERRSOURCE. + +2004-12-15 Werner Koch + + * sysutils.h [W32]: Prototypes for registry functions. + * w32reg.c: Include sysutils.h + + * simple-pwquery.c [W32]: Dummy code to allow a build. + + * exechelp.c [W32]: Implemented for W32 . + + * ttyname.c: New. + + * asshelp.c (send_one_option): New. + (send_pinentry_environment): Cleaned up and made sure that empty + values are not send. + +2004-12-07 Werner Koch + + * asshelp.c (send_pinentry_environment) [W32]: Do not use ttyname. + +2004-12-06 Werner Koch + + * exechelp.h, exechelp.c: New. Based on code from ../sm/import.c. + +2004-12-03 Werner Koch + + * strsep.c: Fixed copyright comments. + +2004-11-26 Werner Koch + + * simple-gettext.c: New taken from gnupg 1.3.x + + * simple-pwquery.c [_WIN32]: Include winsock2.h. + (agent_open): Disable it until we have our AF_UNIX implementation + ready. + * fseeko.c, ftello.c: Include sys/types for the sake of W32. + +2004-11-23 Werner Koch + + * b64enc.c: Include stdio.h and string.h + +2004-08-18 Werner Koch + + * simple-pwquery.c (simple_pwquery): Handle gpg-error style return + code for canceled. + +2004-07-20 Werner Koch + + * maperror.c: Removed header ksba.h. Not required anymore. + +2004-06-14 Werner Koch + + * xreadline.c: New. Based on the iobuf_read_line function. + +2004-05-12 Werner Koch + + * util.h (xtrycalloc_secure,xtrymalloc_secure): New. + +2004-05-11 Werner Koch + + * sysutils.c (disable_core_dumps): Only set the current limit. + (enable_core_dumps): New. + +2004-04-13 Werner Koch + + * simple-pwquery.c (copy_and_escape): Relaxed quoting. + +2004-04-05 Werner Koch + + * errors.h (STATUS_NEWSIG): New. + +2004-03-11 Werner Koch + + * dynload.h [__MINGW32__]: Define RTLD_LAZY. + +2004-03-09 Werner Koch + + * maperror.c (map_assuan_err): Map the Locale_Problem item. + +2004-03-03 Werner Koch + + * asshelp.c, asshelp.h: New. + (send_pinentry_environment): New. Code taken from ../sm/call-agent.c. + +2004-02-19 Werner Koch + + * simple-pwquery.c (agent_open): Don't mangle INFOSTR. + +2004-02-17 Werner Koch + + * simple-pwquery.c (agent_open): Ignore an empty GPG_AGENT_INFO. + + * errors.h: Added STATUS_IMPORT_OK. + +2004-02-10 Werner Koch + + * b64enc.c: New. Based on code from ../sm/base64.c. + +2004-01-30 Marcus Brinkmann + + * Makefile.am (libcommon_a_SOURCES): Add xasprintf.c. + * miscellaneous.c (xasprintf): Moved to ... + * xasprintf (xasprintf): ... here. New file. + This allows to use xasprintf without sucking in gpg-error. + +2004-01-27 Werner Koch + + * sexp-parse.h: New; moved from../agent. + + * util.h (xtoi_4): New. + +2003-12-23 Werner Koch + + * maperror.c (map_assuan_err): Prepared for a new error code. + +2003-12-17 Werner Koch + + * gettime.c (asctimestamp): Add a note on a non-avoidable gcc warning. + + * util.h [!HAVE_VASPRINTF]: Add printf format attribute to the + replacement function. + + * miscellaneous.c (xasprintf): New. + +2003-11-14 Werner Koch + + * mkdtemp.c (mkdtemp): Use gcry_create_nonce. + + * cryptmiss.c: Removed. + +2003-11-13 Werner Koch + + * util.h (vasprintf): Also fixed the prototype. + + * vasprintf.c (vasprintf): ARGS should not be a pointer. Fixed + segv on Solaris. Reported by Andrew J. Schorr. + +2003-11-12 Werner Koch + + * maperror.c (map_ksba_err, map_gcry_err, map_kbx_err): Removed. + +2003-10-31 Werner Koch + + * util.h (gnupg_isotime_t): New. + (gnupg_copy_time): New. + + * gettime.c (gnupg_get_isotime): New. + +2003-09-23 Werner Koch + + * iobuf.c (check_special_filename): Replaced is isdigit by digitp + to avoid passing negative values and potential locale problems. + Problem noted by Christian Biere. + + * util.h (ascii_isspace): New. + +2003-09-18 Werner Koch + + * ttyio.c (tty_fprintf): New. + (tty_print_string, tty_print_utf8_string2) + (tty_print_utf8_string): Made P argument const byte*. + +2003-08-20 Marcus Brinkmann + + * maperror.c (map_ksba_err): Map -1. Use gpg_err_make to set + the error source. + +2003-08-14 Timo Schulz + + * dynload.h. New. W32 wrapper around the dynload mechanism. + +2003-07-15 Werner Koch + + * simple-pwquery.c, simple-pwquery.h: New; moved from ../agent. + * Makefile.am (libsimple_pwquery_a_LIBADD): New. + +2003-06-25 Werner Koch + + * maperror.c (map_to_assuan_status): Directly map 0 to 0. + +2003-06-17 Werner Koch + + * gettime.c (scan_isodatestr,add_days_to_timestamp,strtimevalue) + (strtimestamp,asctimestamp): New. Code taken from gnupg 1.3.2 + mischelp.c. + + * yesno.c: New. Code taken from gnupg 1.3.2 mischelp.c + + * miscellaneous.c: New. + + * util.h: Include utf8conf.h + +2003-06-16 Werner Koch + + * gettime.c (make_timestamp): New. + + * ttyio.c: New. Taken from gnupg 1.2. + * ttyio.h: Move from ../include. + +2003-06-13 Werner Koch + + * util.h (seterr): Removed macro. + (xmalloc_secure,xcalloc_secure): New. + +2003-06-11 Werner Koch + + * iobuf.c (iobuf_writebyte,iobuf_write): Return error code from + iobuf_flush. + (iobuf_writestr): Ditto. + +2003-06-10 Werner Koch + + * iobuf.c, iobuf.h: New. Taken from current gnupg 1.3 CVS. Run + indent on it and adjusted error handling to libgpg-error style. + Replaced IOBUF by iobuf_t. Renamed malloc functions. + +2003-06-04 Werner Koch + + * errors.h: Removed all error codes. We keep the status codes for + now. + * Makefile.am: Do not create errors.c anymore; remove it from the + sources. + + * maperror.c: Don't include error.h. Change all error codes to + libgpg-error style. + (map_assuan_err): Changed to new Assuan error code convention. + (map_to_assuan_status): Likewise. + (map_gcry_err,map_kbx_err): Not needed. For now dummy functions. + + * membuf.c, membuf.h: New. Code taken from ../sm/call-agent.h. + * Makefile.am: Added above. + +2003-04-29 Werner Koch + + * util.h (fopencokokie): Removed prototype and struct. + + * fopencookie.c: Removed. + + * maperror.c: Use system assuan.h + +2002-10-31 Neal H. Walfield + + * isascii.c: New file. + * putc_unlocked.c: Likewise. + +2002-10-28 Neal H. Walfield + + * signal.c (caught_fatal_sig): Remove superfluous zero + initializer. + (caught_sigusr1): Likewise. + +2002-09-04 Neal H. Walfield + + * vasprintf.c (vasprintf) [va_copy]: Use va_copy. + [!va_copy && __va_copy]: Use __va_copy. + [!va_copy && !__va_copy]: Only now fall back to using memcpy. + +2002-08-21 Werner Koch + + * errors.h: Added STATUS_IMPORT_PROBLEM. + +2002-08-20 Werner Koch + + * vasprintf.c: Hack to handle NULL for %s. + +2002-08-09 Werner Koch + + * signal.c: New. Taken from GnuPG 1.1.91. + +2002-07-23 Werner Koch + + * util.h (_IO_cookie_io_functions_t): Fixed typo. Noted by + Richard Lefebvre. + +2002-07-22 Werner Koch + + * fseeko.c, ftello.c: New. + +2002-06-28 Werner Koch + + * maperror.c (map_to_assuan_status): Map more errorcodes to Bad + Certificate. + +2002-06-26 Werner Koch + + * maperror.c (map_to_assuan_status): Map EOF to No_Data_Available. + +2002-06-10 Werner Koch + + * errors.h (gnupg_error_token): Add new prototype. + (STATUS_ERROR): New. + + * mkerrtok: New. + * Makefile.am: Use it to create the new error token function. + +2002-06-04 Werner Koch + + * maperror.c (map_to_assuan_status): Map Bad_CA_Certificate. + +2002-05-23 Werner Koch + + * no-pth.c, Makefile.am: Removed. + +2002-05-22 Werner Koch + + * mkdtemp.c: Replaced byte by unsigned char because it is no longer + defined in gcrypt.h. + +2002-05-21 Werner Koch + + * maperror.c (map_gcry_err): Add libgcrypt's new S-expression errors. + (map_ksba_err): Add a few mappings. + +2002-05-14 Werner Koch + + * gettime.c: New. + +2002-05-03 Werner Koch + + * errors.h: Added STARUS_EXPSIG and STATUS_EXPKEYSIG. + +2002-04-15 Werner Koch + + * cryptmiss.c: New. + +2002-02-14 Werner Koch + + * maperror.c: Add more assuan<->gnupg mappings. + +2002-02-12 Werner Koch + + * fopencookie.c: Dummy function. + + * vasprintf.c: New. Taken from binutils-2.9.1 and dropped all non + ANSI-C stuff. Merged with asprintf version. + + * no-pth.c: New. + +2002-01-23 Werner Koch + + * mkdtemp.c: Copied from gnupg-1.0.6c and changed to use libgcrypt. + +2002-01-19 Werner Koch + + * sysutils.c: New. This is the misc.c file from gnupg 1.0.6 with + the OpenPGP stuff removed. + * sysutils.h: New. + +2002-01-15 Werner Koch + + * maperror.c: Add mapping for Not_Trusted. + +2002-01-11 Werner Koch + + * maperror.c (map_assuan_err): Codes for CRL + +2002-01-08 Werner Koch + + * util.h (spacep): New. + +2002-01-02 Werner Koch + + * maperror.c (map_to_assuan_status): New. Merged from ../agent + and ../sm. + +2001-12-20 Werner Koch + + * maperror.c (map_gcry_err): Add some mappings. + +2001-12-18 Werner Koch + + * Makefile.am (AM_CPPFLAGS): Include flags for gcrypt and ksba + +2001-12-14 Werner Koch + + * util.h (digitp, hexdigitp): New ctype like macros. + (atoi_1,atoi_2,atoi_4,xtoi_1,xtoi_2): New. + + + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010, 2011 Free Software Foundation, Inc. + + This file is free software; as a special exception the author gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Local Variables: +buffer-read-only: t +End: diff --git a/common/ChangeLog.jnlib b/common/ChangeLog.jnlib index f51525e42..4ac02f3c2 100644 --- a/common/ChangeLog.jnlib +++ b/common/ChangeLog.jnlib @@ -1,3 +1,10 @@ +2011-12-01 Werner Koch + + NB: ChangeLog files are no longer manually maintained. Starting + on December 1st, 2011 we put change information only in the GIT + commit log, and generate a top-level ChangeLog file from logs at + "make dist". See doc/HACKING for details. + 2010-03-10 Werner Koch See gnupg/common/ChangeLog for newer changes. @@ -767,3 +774,7 @@ Mon Jan 24 13:04:28 CET 2000 Werner Koch This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Local Variables: +buffer-read-only: t +End: diff --git a/common/Makefile.am b/common/Makefile.am index 7821e0442..bb996bab7 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -18,7 +18,7 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = mkstrtable.awk exaudit.awk exstatus.awk \ +EXTRA_DIST = mkstrtable.awk exaudit.awk exstatus.awk ChangeLog-2011 \ audit-events.h status-codes.h README.jnlib ChangeLog.jnlib noinst_LIBRARIES = libcommon.a libcommonpth.a libgpgrl.a -- cgit v1.2.3 From 00c760f628f4cf0fc11e79d305c172f98123f815 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 13 Dec 2011 17:59:00 +0100 Subject: scd: New option --debug-assuan-log-cats. * scd/scdaemon.c (oDebugAssuanLogCats): New. (opts): Add option --debug-assuan-log-cats. (main): Implement option. * common/asshelp.c (set_libassuan_log_cats): New. -- The old way of setting the logging categories with an environment variable is awkward if sdaemon is spawned from a running gpg-agent. --- common/asshelp.c | 13 +++++++++++++ common/asshelp.h | 1 + 2 files changed, 14 insertions(+) (limited to 'common') diff --git a/common/asshelp.c b/common/asshelp.c index c5d8bdf84..7ac6ff0cc 100644 --- a/common/asshelp.c +++ b/common/asshelp.c @@ -97,6 +97,19 @@ setup_libassuan_logging (unsigned int *debug_var_address) assuan_set_log_cb (my_libassuan_log_handler, debug_var_address); } +/* Change the Libassuan log categories to those given by NEWCATS. + NEWCATS is 0 the default category of ASSUAN_LOG_CONTROL is + selected. Note, that setup_libassuan_logging overrides the values + given here. */ +void +set_libassuan_log_cats (unsigned int newcats) +{ + if (newcats) + log_cats = newcats; + else /* Default to log the control channel. */ + log_cats = (1 << (ASSUAN_LOG_CONTROL - 1)); +} + static gpg_error_t diff --git a/common/asshelp.h b/common/asshelp.h index 0eb6553f9..728c03949 100644 --- a/common/asshelp.h +++ b/common/asshelp.h @@ -26,6 +26,7 @@ #include "session-env.h" void setup_libassuan_logging (unsigned int *debug_var_address); +void set_libassuan_log_cats (unsigned int newcats); gpg_error_t -- cgit v1.2.3 From 7737a2c269657189a583cde7f214f20871d264f8 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 15 Dec 2011 14:45:08 +0100 Subject: estream: New function es_fclose_snatch. * common/estream.c (cookie_ioctl_function_t): New type. (es_fclose_snatch): New function. (COOKIE_IOCTL_SNATCH_BUFFER): New constant. (struct estream_internal): Add field FUNC_IOCTL. (es_initialize): Clear FUNC_IOCTL. (es_func_mem_ioctl): New function. (es_fopenmem, es_fopenmem_init): Init FUNC_IOCTL. --- common/estream.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ common/estream.h | 4 ++- 2 files changed, 109 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/estream.c b/common/estream.c index c55c7f26d..6b7bd8b75 100644 --- a/common/estream.c +++ b/common/estream.c @@ -217,6 +217,17 @@ struct notify_list_s }; typedef struct notify_list_s *notify_list_t; + +/* A private cookie function to implement an internal IOCTL + service. */ +typedef int (*cookie_ioctl_function_t) (void *cookie, int cmd, + void *ptr, size_t *len); +/* IOCTL commands for the private cookie function. */ +#define COOKIE_IOCTL_SNATCH_BUFFER 1 + + + + /* An internal stream object. */ struct estream_internal { @@ -231,6 +242,7 @@ struct estream_internal es_cookie_read_function_t func_read; es_cookie_write_function_t func_write; es_cookie_seek_function_t func_seek; + cookie_ioctl_function_t func_ioctl; es_cookie_close_function_t func_close; int strategy; es_syshd_t syshd; /* A copy of the sytem handle. */ @@ -771,6 +783,33 @@ es_func_mem_seek (void *cookie, off_t *offset, int whence) return 0; } +/* An IOCTL function for memory objects. */ +static int +es_func_mem_ioctl (void *cookie, int cmd, void *ptr, size_t *len) +{ + estream_cookie_mem_t mem_cookie = cookie; + int ret; + + if (cmd == COOKIE_IOCTL_SNATCH_BUFFER) + { + /* Return the internal buffer of the stream to the caller and + invalidate it for the stream. */ + *(void**)ptr = mem_cookie->memory; + *len = mem_cookie->offset; + mem_cookie->memory = NULL; + mem_cookie->memory_size = 0; + mem_cookie->offset = 0; + ret = 0; + } + else + { + _set_errno (EINVAL); + ret = -1; + } + + return ret; +} + /* Destroy function for memory objects. */ static int @@ -1608,6 +1647,7 @@ es_initialize (estream_t stream, stream->intern->func_read = functions.func_read; stream->intern->func_write = functions.func_write; stream->intern->func_seek = functions.func_seek; + stream->intern->func_ioctl = NULL; stream->intern->func_close = functions.func_close; stream->intern->strategy = _IOFBF; stream->intern->syshd = *syshd; @@ -2667,6 +2707,9 @@ es_fopenmem (size_t memlimit, const char *ES__RESTRICT mode) if (es_create (&stream, cookie, &syshd, estream_functions_mem, modeflags, 0)) (*estream_functions_mem.func_close) (cookie); + if (stream) + stream->intern->func_ioctl = es_func_mem_ioctl; + return stream; } @@ -2701,6 +2744,10 @@ es_fopenmem_init (size_t memlimit, const char *ES__RESTRICT mode, es_set_indicators (stream, 0, 0); } } + + if (stream) + stream->intern->func_ioctl = es_func_mem_ioctl; + return stream; } @@ -3082,6 +3129,65 @@ es_fclose (estream_t stream) } +/* This is a special version of es_fclose which can be used with + es_fopenmem to return the memory buffer. This is feature is useful + to write to a memory buffer using estream. Note that the function + does not close the stream if the stream does not support snatching + the buffer. On error NULL is stored at R_BUFFER. Note that if no + write operation has happened, NULL may also be stored at BUFFER on + success. The caller needs to release the returned memory using + es_free. */ +int +es_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen) +{ + int err; + + /* Note: There is no need to lock the stream in a close call. The + object will be destroyed after the close and thus any other + contender for the lock would work on a closed stream. */ + + if (r_buffer) + { + cookie_ioctl_function_t func_ioctl = stream->intern->func_ioctl; + size_t buflen; + + *r_buffer = NULL; + + if (!func_ioctl) + { + _set_errno (EOPNOTSUPP); + err = -1; + goto leave; + } + + if (stream->flags.writing) + { + err = es_flush (stream); + if (err) + goto leave; + stream->flags.writing = 0; + } + + err = func_ioctl (stream->intern->cookie, COOKIE_IOCTL_SNATCH_BUFFER, + r_buffer, &buflen); + if (err) + goto leave; + if (r_buflen) + *r_buflen = buflen; + } + + err = do_close (stream, 0); + + leave: + if (err && r_buffer) + { + mem_free (*r_buffer); + *r_buffer = NULL; + } + return err; +} + + /* Register or unregister a close notification function for STREAM. FNC is the function to call and FNC_VALUE the value passed as second argument. To register the notification the value for MODE diff --git a/common/estream.h b/common/estream.h index 49662766e..bbe5b62d6 100644 --- a/common/estream.h +++ b/common/estream.h @@ -1,5 +1,5 @@ /* estream.h - Extended stream I/O Library - * Copyright (C) 2004, 2005, 2006, 2007, 2010 g10 Code GmbH + * Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 g10 Code GmbH * * This file is part of Libestream. * @@ -88,6 +88,7 @@ #define es_freopen _ESTREAM_PREFIX(es_freopen) #define es_fopencookie _ESTREAM_PREFIX(es_fopencookie) #define es_fclose _ESTREAM_PREFIX(es_fclose) +#define es_fclose_snatch _ESTREAM_PREFIX(es_fclose_snatch) #define es_onclose _ESTREAM_PREFIX(es_onclose) #define es_fileno _ESTREAM_PREFIX(es_fileno) #define es_fileno_unlocked _ESTREAM_PREFIX(es_fileno_unlocked) @@ -285,6 +286,7 @@ estream_t es_fopencookie (void *ES__RESTRICT cookie, const char *ES__RESTRICT mode, es_cookie_io_functions_t functions); int es_fclose (estream_t stream); +int es_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen); int es_onclose (estream_t stream, int mode, void (*fnc) (estream_t, void*), void *fnc_value); int es_fileno (estream_t stream); -- cgit v1.2.3 From 0dce26778ef8abd4fc40de689d7ec9b720d26430 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 3 Jan 2012 17:08:01 +0100 Subject: Fix compiler warnings. * common/dotlock.c (use_hardlinks_p, dotlock_take_unix): Check return value of link(). * g13/g13.c: Make sure err is initialized. * scd/scdaemon.c (main) [!USE_GCRY_THREAD_CBS]: Do not define ERR. --- common/dotlock.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'common') diff --git a/common/dotlock.c b/common/dotlock.c index b4734b99f..58a3d0f2a 100644 --- a/common/dotlock.c +++ b/common/dotlock.c @@ -583,16 +583,21 @@ use_hardlinks_p (const char *tname) strcpy (lname, tname); strcat (lname, "x"); - link (tname, lname); - - if (stat (tname, &sb)) - res = -1; /* Ooops. */ - else if (sb.st_nlink == nlink + 1) - res = 0; /* Yeah, hardlinks are supported. */ + res = link (tname, lname); + if (res < 0) + res = -1; else - res = 1; /* No hardlink support. */ + { + if (stat (tname, &sb)) + res = -1; /* Ooops. */ + else if (sb.st_nlink == nlink + 1) + res = 0; /* Yeah, hardlinks are supported. */ + else + res = 1; /* No hardlink support. */ + + unlink (lname); + } - unlink (lname); jnlib_free (lname); return res; } @@ -948,6 +953,7 @@ dotlock_destroy (dotlock_t h) static int dotlock_take_unix (dotlock_t h, long timeout) { + int res; int wtime = 0; int sumtime = 0; int pid; @@ -1004,7 +1010,13 @@ dotlock_take_unix (dotlock_t h, long timeout) { struct stat sb; - link (h->tname, h->lockname); + res = link (h->tname, h->lockname); + if (res < 0) + { + my_error_1 ("lock not made: Oops: link of tmp file failed: %s\n", + strerror (errno)); + return -1; + } if (stat (h->tname, &sb)) { -- cgit v1.2.3 From ff2095ad7b4be7eaf9468b6ef39fd979527ecc4f Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 3 Jan 2012 17:32:41 +0100 Subject: Revert last change, add comment about link() return values. * common/dotlock.c (use_hardlinks_p, dotlock_take_unix): Do not check return value of link(). --- common/dotlock.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'common') diff --git a/common/dotlock.c b/common/dotlock.c index 58a3d0f2a..5e17e64c6 100644 --- a/common/dotlock.c +++ b/common/dotlock.c @@ -583,21 +583,17 @@ use_hardlinks_p (const char *tname) strcpy (lname, tname); strcat (lname, "x"); - res = link (tname, lname); - if (res < 0) - res = -1; - else - { - if (stat (tname, &sb)) - res = -1; /* Ooops. */ - else if (sb.st_nlink == nlink + 1) - res = 0; /* Yeah, hardlinks are supported. */ - else - res = 1; /* No hardlink support. */ + /* We ignore the return value of link() because it is unreliable. */ + (void) link (tname, lname); - unlink (lname); - } + if (stat (tname, &sb)) + res = -1; /* Ooops. */ + else if (sb.st_nlink == nlink + 1) + res = 0; /* Yeah, hardlinks are supported. */ + else + res = 1; /* No hardlink support. */ + unlink (lname); jnlib_free (lname); return res; } @@ -953,7 +949,6 @@ dotlock_destroy (dotlock_t h) static int dotlock_take_unix (dotlock_t h, long timeout) { - int res; int wtime = 0; int sumtime = 0; int pid; @@ -1010,13 +1005,8 @@ dotlock_take_unix (dotlock_t h, long timeout) { struct stat sb; - res = link (h->tname, h->lockname); - if (res < 0) - { - my_error_1 ("lock not made: Oops: link of tmp file failed: %s\n", - strerror (errno)); - return -1; - } + /* We ignore the return value of link() because it is unreliable. */ + (void) link (h->tname, h->lockname); if (stat (h->tname, &sb)) { -- cgit v1.2.3