summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-12-07 16:33:51 +0000
committerjsing <jsing@openbsd.org>2014-12-07 16:33:51 +0000
commit53369472f25d7beddbc89e8b12961e96311d9302 (patch)
tree45549c1af46aa00da9e20c5b05691b153553f292 /lib/libssl/src
parentCorrectly output the result in STREEBOG512_Final() when running on a big-endian (diff)
downloadwireguard-openbsd-53369472f25d7beddbc89e8b12961e96311d9302.tar.xz
wireguard-openbsd-53369472f25d7beddbc89e8b12961e96311d9302.zip
Make GOST compile with a strict C compiler - in this case incrementing a
void pointer is undefined and initialising an array with {} is a syntax error. Based on a diff from kinichiro inoguchi.
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/gost/gost2814789.c6
-rw-r--r--lib/libssl/src/crypto/gost/gostr341194.c5
-rw-r--r--lib/libssl/src/crypto/gost/streebog.c11
3 files changed, 12 insertions, 10 deletions
diff --git a/lib/libssl/src/crypto/gost/gost2814789.c b/lib/libssl/src/crypto/gost/gost2814789.c
index 1c11ddd93eb..e1084cb4acf 100644
--- a/lib/libssl/src/crypto/gost/gost2814789.c
+++ b/lib/libssl/src/crypto/gost/gost2814789.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gost2814789.c,v 1.2 2014/11/09 23:06:52 miod Exp $ */
+/* $OpenBSD: gost2814789.c,v 1.3 2014/12/07 16:33:51 jsing Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -416,8 +416,8 @@ GOST2814789IMIT_Init(GOST2814789IMIT_CTX *c, int nid)
}
static void
-GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx, const void *p,
- size_t num)
+GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx,
+ const unsigned char *p, size_t num)
{
int i;
diff --git a/lib/libssl/src/crypto/gost/gostr341194.c b/lib/libssl/src/crypto/gost/gostr341194.c
index 3151d9fe127..34ca504bb2e 100644
--- a/lib/libssl/src/crypto/gost/gostr341194.c
+++ b/lib/libssl/src/crypto/gost/gostr341194.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gostr341194.c,v 1.2 2014/11/09 23:06:52 miod Exp $ */
+/* $OpenBSD: gostr341194.c,v 1.3 2014/12/07 16:33:51 jsing Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -207,7 +207,8 @@ GOSTR341194_Init(GOSTR341194_CTX *c, int nid)
}
static void
-GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const void *p, size_t num)
+GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const unsigned char *p,
+ size_t num)
{
int i;
diff --git a/lib/libssl/src/crypto/gost/streebog.c b/lib/libssl/src/crypto/gost/streebog.c
index 4e49201c2de..8060161d11f 100644
--- a/lib/libssl/src/crypto/gost/streebog.c
+++ b/lib/libssl/src/crypto/gost/streebog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: streebog.c,v 1.3 2014/12/07 16:07:56 miod Exp $ */
+/* $OpenBSD: streebog.c,v 1.4 2014/12/07 16:33:51 jsing Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -1269,7 +1269,8 @@ streebog_single_block(STREEBOG_CTX *ctx, const unsigned char *in, size_t num)
static void
-streebog_block_data_order(STREEBOG_CTX *ctx, const void *in, size_t num)
+streebog_block_data_order(STREEBOG_CTX *ctx, const unsigned char *in,
+ size_t num)
{
int i;
@@ -1280,12 +1281,12 @@ streebog_block_data_order(STREEBOG_CTX *ctx, const void *in, size_t num)
int
STREEBOG512_Final(unsigned char *md, STREEBOG_CTX *c)
{
- int n;
unsigned char *p = (unsigned char *)c->data;
- STREEBOG_LONG64 Z[STREEBOG_LBLOCK] = {};
+ STREEBOG_LONG64 Z[STREEBOG_LBLOCK] = {0};
+ int n;
if (c->num == STREEBOG_CBLOCK) {
- streebog_block_data_order(c, c->data, 1);
+ streebog_block_data_order(c, p, 1);
c->num -= STREEBOG_CBLOCK;
}