fix buildability of programs using gcrypt.h with -ansi (#1182200)

This commit is contained in:
Tomas Mraz 2015-01-14 17:02:08 +01:00
parent 040c39b7c3
commit 6898eaa051
2 changed files with 19 additions and 19 deletions

View File

@ -2553,7 +2553,7 @@ diff -up libgcrypt-1.6.2/src/gcrypt.h.in.drbg libgcrypt-1.6.2/src/gcrypt.h.in
}; };
/* Perform various operations defined by CMD. */ /* Perform various operations defined by CMD. */
@@ -1668,6 +1670,112 @@ int gcry_is_secure (const void *a) _GCRY @@ -1668,6 +1670,109 @@ int gcry_is_secure (const void *a) _GCRY
/* Return true if Libgcrypt is in FIPS mode. */ /* Return true if Libgcrypt is in FIPS mode. */
#define gcry_fips_mode_active() !!gcry_control (GCRYCTL_FIPS_MODE_P, 0) #define gcry_fips_mode_active() !!gcry_control (GCRYCTL_FIPS_MODE_P, 0)
@ -2583,25 +2583,22 @@ diff -up libgcrypt-1.6.2/src/gcrypt.h.in.drbg libgcrypt-1.6.2/src/gcrypt.h.in
+ struct gcry_drbg_string *next; + struct gcry_drbg_string *next;
+}; +};
+ +
+static inline void gcry_drbg_string_fill(struct gcry_drbg_string *string, +#define gcry_drbg_string_fill(s, b, l) \
+ const unsigned char *buf, size_t len) +do { \
+{ + (s)->buf = (b); \
+ string->buf = buf; + (s)->len = (l); \
+ string->len = len; + (s)->next = NULL; \
+ string->next = NULL; +} while (0)
+}
+ +
+/* this is a wrapper function for users of libgcrypt */ +/* this is a wrapper function for users of libgcrypt */
+static inline void gcry_randomize_drbg(void *outbuf, size_t outlen, +#define gcry_randomize_drbg(ob, ol, lvl, add) \
+ enum gcry_random_level level, +do { \
+ struct gcry_drbg_string *addtl) + struct gcry_drbg_gen genbuf; \
+{ + genbuf.outbuf = (unsigned char *)(ob); \
+ struct gcry_drbg_gen genbuf; + genbuf.outlen = (ol); \
+ genbuf.outbuf = (unsigned char *)outbuf; + genbuf.addtl = (add); \
+ genbuf.outlen = outlen; + gcry_randomize(&genbuf, 0, (lvl)); \
+ genbuf.addtl = addtl; +} while (0)
+ gcry_randomize(&genbuf, 0, level);
+}
+ +
+/* +/*
+ * DRBG flags bitmasks + * DRBG flags bitmasks

View File

@ -1,6 +1,6 @@
Name: libgcrypt Name: libgcrypt
Version: 1.6.2 Version: 1.6.2
Release: 1%{?dist} Release: 2%{?dist}
URL: http://www.gnupg.org/ URL: http://www.gnupg.org/
Source0: libgcrypt-%{version}-hobbled.tar.xz Source0: libgcrypt-%{version}-hobbled.tar.xz
# The original libgcrypt sources now contain potentially patented ECC # The original libgcrypt sources now contain potentially patented ECC
@ -201,6 +201,9 @@ exit 0
%license COPYING %license COPYING
%changelog %changelog
* Wed Jan 14 2015 Tomáš Mráz <tmraz@redhat.com> 1.6.2-2
- fix buildability of programs using gcrypt.h with -ansi (#1182200)
* Mon Dec 8 2014 Tomáš Mráz <tmraz@redhat.com> 1.6.2-1 * Mon Dec 8 2014 Tomáš Mráz <tmraz@redhat.com> 1.6.2-1
- new upstream version - new upstream version