[git] GCRYPT - branch, master, updated. libgcrypt-1.7.1-6-g1feb019
by Werner Koch
cvs at cvs.gnupg.org
Sat Jun 25 16:12:15 CEST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".
The branch, master has been updated
via 1feb01940062a74c27230434fc3babdddca8caf4 (commit)
via c870cb5d385c1d6e1e28ca481cf9cf44b3bfeea9 (commit)
from 5a5b055b81ee60a22a846bdf2031516b1c24df98 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1feb01940062a74c27230434fc3babdddca8caf4
Author: Werner Koch <wk at gnupg.org>
Date: Sat Jun 25 16:07:16 2016 +0200
doc: Update yat2m.
* doc/yat2m.c: Update from Libgpg-error
--
Taken from Libgpg-error
commit 9b5e3d1608922f4aaf9958e022431849d5a58501
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/doc/yat2m.c b/doc/yat2m.c
index 86c3c70..7599081 100644
--- a/doc/yat2m.c
+++ b/doc/yat2m.c
@@ -1,5 +1,5 @@
/* yat2m.c - Yet Another Texi 2 Man converter
- * Copyright (C) 2005, 2013 g10 Code GmbH
+ * Copyright (C) 2005, 2013, 2015, 2016 g10 Code GmbH
* Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
/*
@@ -104,6 +104,29 @@
#include <time.h>
+#if __GNUC__
+# define MY_GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#else
+# define MY_GCC_VERSION 0
+#endif
+
+#if MY_GCC_VERSION >= 20500
+# define ATTR_PRINTF(f, a) __attribute__ ((format(printf,f,a)))
+# define ATTR_NR_PRINTF(f, a) __attribute__ ((noreturn, format(printf,f,a)))
+#else
+# define ATTR_PRINTF(f, a)
+# define ATTR_NR_PRINTF(f, a)
+#endif
+#if MY_GCC_VERSION >= 30200
+# define ATTR_MALLOC __attribute__ ((__malloc__))
+#else
+# define ATTR_MALLOC
+#endif
+
+
+
#define PGM "yat2m"
#define VERSION "1.0"
@@ -120,6 +143,7 @@ static int quiet;
static int debug;
static const char *opt_source;
static const char *opt_release;
+static const char *opt_date;
static const char *opt_select;
static const char *opt_include;
static int opt_store;
@@ -213,8 +237,16 @@ static const char * const standard_sections[] =
static void proc_texi_buffer (FILE *fp, const char *line, size_t len,
int *table_level, int *eol_action);
+static void die (const char *format, ...) ATTR_NR_PRINTF(1,2);
+static void err (const char *format, ...) ATTR_PRINTF(1,2);
+static void inf (const char *format, ...) ATTR_PRINTF(1,2);
+static void *xmalloc (size_t n) ATTR_MALLOC;
+static void *xcalloc (size_t n, size_t m) ATTR_MALLOC;
+
+/*-- Functions --*/
+
/* Print diagnostic message and exit with failure. */
static void
die (const char *format, ...)
@@ -323,8 +355,12 @@ isodatestring (void)
{
static char buffer[11+5];
struct tm *tp;
- time_t atime = time (NULL);
+ time_t atime;
+ if (opt_date && *opt_date)
+ atime = strtoul (opt_date, NULL, 10);
+ else
+ atime = time (NULL);
if (atime < 0)
strcpy (buffer, "????" "-??" "-??");
else
@@ -553,7 +589,7 @@ get_section_buffer (const char *name)
for (i=0; i < thepage.n_sections; i++)
if (!thepage.sections[i].name)
break;
- if (i < thepage.n_sections)
+ if (thepage.n_sections && i < thepage.n_sections)
sect = thepage.sections + i;
else
{
@@ -679,6 +715,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
} cmdtbl[] = {
{ "command", 0, "\\fB", "\\fR" },
{ "code", 0, "\\fB", "\\fR" },
+ { "url", 0, "\\fB", "\\fR" },
{ "sc", 0, "\\fB", "\\fR" },
{ "var", 0, "\\fI", "\\fR" },
{ "samp", 0, "\\(aq", "\\(aq" },
@@ -699,6 +736,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
{ "emph", 0, "\\fI", "\\fR" },
{ "w", 1 },
{ "c", 5 },
+ { "efindex", 1 },
{ "opindex", 1 },
{ "cpindex", 1 },
{ "cindex", 1 },
@@ -846,7 +884,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
}
else
inf ("texinfo command '%s' not supported (%.*s)", command,
- ((s = memchr (rest, '\n', len)), (s? (s-rest) : len)), rest);
+ (int)((s = memchr (rest, '\n', len)), (s? (s-rest) : len)), rest);
}
if (*rest == '{')
@@ -958,7 +996,7 @@ proc_texi_buffer (FILE *fp, const char *line, size_t len,
assert (n <= len);
s += n; len -= n;
s--; len++;
- in_cmd = 0;
+ /* in_cmd = 0; -- doc only */
}
}
@@ -1367,7 +1405,7 @@ parse_file (const char *fname, FILE *fp, char **section_name, int in_pause)
}
if (!incfp)
- err ("can't open include file '%s':%s",
+ err ("can't open include file '%s': %s",
incname, strerror (errno));
else
{
@@ -1466,13 +1504,14 @@ main (int argc, char **argv)
"Extract man pages from a Texinfo source.\n\n"
" --source NAME use NAME as source field\n"
" --release STRING use STRING as the release field\n"
+ " --date EPOCH use EPOCH as publication date\n"
" --store write output using @manpage name\n"
" --select NAME only output pages with @manpage NAME\n"
" --verbose enable extra informational output\n"
" --debug enable additional debug output\n"
" --help display this help and exit\n"
" -I DIR also search in include DIR\n"
- " -D gpgone the only useable define\n\n"
+ " -D gpgone the only usable define\n\n"
"With no FILE, or when FILE is -, read standard input.\n\n"
"Report bugs to <bugs at g10code.com>.");
exit (0);
@@ -1519,6 +1558,15 @@ main (int argc, char **argv)
argc--; argv++;
}
}
+ else if (!strcmp (*argv, "--date"))
+ {
+ argc--; argv++;
+ if (argc)
+ {
+ opt_date = *argv;
+ argc--; argv++;
+ }
+ }
else if (!strcmp (*argv, "--store"))
{
opt_store = 1;
commit c870cb5d385c1d6e1e28ca481cf9cf44b3bfeea9
Author: Werner Koch <wk at gnupg.org>
Date: Sat Jun 25 16:09:20 2016 +0200
tests: Add attributes to helper functions.
* tests/t-common.h (die, fail, info): Add attributes.
* tests/random.c (die, inf): Ditto.
* tests/pubkey.c (die, fail, info): Add attributes.
* tests/fipsdrv.c (die): Add attribute.
(main): Take care of missing --key,--iv,--dt options.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/tests/fipsdrv.c b/tests/fipsdrv.c
index 49253cb..63c5176 100644
--- a/tests/fipsdrv.c
+++ b/tests/fipsdrv.c
@@ -134,6 +134,11 @@ struct tag_info
};
+/* If we have a decent libgpg-error we can use some gcc attributes. */
+#ifdef GPGRT_ATTR_NORETURN
+static void die (const char *format, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+#endif /*GPGRT_ATTR_NORETURN*/
+
/* Print a error message and exit the process with an error code. */
static void
@@ -1150,7 +1155,7 @@ run_cipher_mct_loop (int encrypt_mode, int cipher_algo, int cipher_mode,
blocklen = gcry_cipher_get_algo_blklen (cipher_algo);
if (!blocklen || blocklen > sizeof output)
- die ("invalid block length %d\n", blocklen);
+ die ("invalid block length %d\n", (int)blocklen);
gcry_cipher_ctl (hd, PRIV_CIPHERCTL_DISABLE_WEAK_KEY, NULL, 0);
@@ -2570,7 +2575,8 @@ main (int argc, char **argv)
die ("no version info in input\n");
}
if (atoi (key_buffer) != 1)
- die ("unsupported input version %s\n", key_buffer);
+ die ("unsupported input version %s\n",
+ (const char*)key_buffer);
gcry_free (key_buffer);
if (!(key_buffer = read_textline (input)))
die ("no iteration count in input\n");
@@ -2644,11 +2650,11 @@ main (int argc, char **argv)
unsigned char buffer[16];
size_t count = 0;
- if (hex2bin (key_string, key, 16) < 0 )
+ if (!key_string || hex2bin (key_string, key, 16) < 0 )
die ("value for --key are not 32 hex digits\n");
- if (hex2bin (iv_string, seed, 16) < 0 )
+ if (!iv_string || hex2bin (iv_string, seed, 16) < 0 )
die ("value for --iv are not 32 hex digits\n");
- if (hex2bin (dt_string, dt, 16) < 0 )
+ if (!dt_string || hex2bin (dt_string, dt, 16) < 0 )
die ("value for --dt are not 32 hex digits\n");
/* The flag value 1 disables the dup check, so that the RNG
diff --git a/tests/pubkey.c b/tests/pubkey.c
index b691913..3eb5b4f 100644
--- a/tests/pubkey.c
+++ b/tests/pubkey.c
@@ -115,6 +115,15 @@ static const char sample_public_key_1[] =
static int verbose;
static int error_count;
+
+/* If we have a decent libgpg-error we can use some gcc attributes. */
+#ifdef GPGRT_ATTR_NORETURN
+static void die (const char *format, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+static void fail (const char *format, ...) GPGRT_ATTR_PRINTF(1,2);
+static void info (const char *format, ...) GPGRT_ATTR_PRINTF(1,2);
+#endif /*GPGRT_ATTR_NORETURN*/
+
+
static void
die (const char *format, ...)
{
diff --git a/tests/random.c b/tests/random.c
index 3c08726..65e5670 100644
--- a/tests/random.c
+++ b/tests/random.c
@@ -43,6 +43,13 @@ static int verbose;
static int debug;
static int with_progress;
+/* If we have a decent libgpg-error we can use some gcc attributes. */
+#ifdef GPGRT_ATTR_NORETURN
+static void die (const char *format, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+static void inf (const char *format, ...) GPGRT_ATTR_PRINTF(1,2);
+#endif /*GPGRT_ATTR_NORETURN*/
+
+
static void
die (const char *format, ...)
{
diff --git a/tests/t-common.h b/tests/t-common.h
index 3546986..68a7804 100644
--- a/tests/t-common.h
+++ b/tests/t-common.h
@@ -52,6 +52,13 @@ static int verbose;
static int debug;
static int errorcount;
+/* If we have a decent libgpg-error we can use some gcc attributes. */
+#ifdef GPGRT_ATTR_NORETURN
+static void die (const char *format, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+static void fail (const char *format, ...) GPGRT_ATTR_PRINTF(1,2);
+static void info (const char *format, ...) GPGRT_ATTR_PRINTF(1,2);
+#endif /*GPGRT_ATTR_NORETURN*/
+
/* Reporting functions. */
static void
diff --git a/tests/t-sexp.c b/tests/t-sexp.c
index 33a58ff..edb37a2 100644
--- a/tests/t-sexp.c
+++ b/tests/t-sexp.c
@@ -81,7 +81,7 @@ hex2mpiopa (const char *string)
die ("hex2mpiopa '%s' failed: parser error\n", string);
val = gcry_mpi_set_opaque (NULL, buffer, buflen*8);
if (!buffer)
- die ("hex2mpiopa '%s' failed: set_opaque error%s\n", string);
+ die ("hex2mpiopa '%s' failed: set_opaque error\n", string);
return val;
}
@@ -510,7 +510,7 @@ back_and_forth_one (int testno, const char *buffer, size_t length)
}
if (compare_to_canon (se1, canon, canonlen))
{
- fail ("baf %d: converting to advanced failed.\n",
+ fail ("baf %d: converting to advanced failed: %s\n",
testno, gpg_strerror (rc));
return;
}
-----------------------------------------------------------------------
Summary of changes:
doc/yat2m.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++-------
tests/fipsdrv.c | 16 +++++++++-----
tests/pubkey.c | 9 ++++++++
tests/random.c | 7 +++++++
tests/t-common.h | 7 +++++++
tests/t-sexp.c | 4 ++--
6 files changed, 92 insertions(+), 15 deletions(-)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
More information about the Gcrypt-devel
mailing list