summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/gost
diff options
context:
space:
mode:
authorjsing <>2014-12-07 16:33:51 +0000
committerjsing <>2014-12-07 16:33:51 +0000
commit6095fdcf15afb6c9da4fd123ad558a7abb9e2524 (patch)
treea2faf277952c8186e6399eadbeaee87c2d4466ce /src/lib/libcrypto/gost
parent4537f91502a17dad41a431e723dbab99cbda4069 (diff)
downloadopenbsd-6095fdcf15afb6c9da4fd123ad558a7abb9e2524.tar.gz
openbsd-6095fdcf15afb6c9da4fd123ad558a7abb9e2524.tar.bz2
openbsd-6095fdcf15afb6c9da4fd123ad558a7abb9e2524.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 'src/lib/libcrypto/gost')
-rw-r--r--src/lib/libcrypto/gost/gost2814789.c6
-rw-r--r--src/lib/libcrypto/gost/gostr341194.c5
-rw-r--r--src/lib/libcrypto/gost/streebog.c11
3 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/libcrypto/gost/gost2814789.c b/src/lib/libcrypto/gost/gost2814789.c
index 1c11ddd93e..e1084cb4ac 100644
--- a/src/lib/libcrypto/gost/gost2814789.c
+++ b/src/lib/libcrypto/gost/gost2814789.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gost2814789.c,v 1.2 2014/11/09 23:06:52 miod Exp $ */ 1/* $OpenBSD: gost2814789.c,v 1.3 2014/12/07 16:33:51 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
4 * Copyright (c) 2005-2006 Cryptocom LTD 4 * Copyright (c) 2005-2006 Cryptocom LTD
@@ -416,8 +416,8 @@ GOST2814789IMIT_Init(GOST2814789IMIT_CTX *c, int nid)
416} 416}
417 417
418static void 418static void
419GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx, const void *p, 419GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx,
420 size_t num) 420 const unsigned char *p, size_t num)
421{ 421{
422 int i; 422 int i;
423 423
diff --git a/src/lib/libcrypto/gost/gostr341194.c b/src/lib/libcrypto/gost/gostr341194.c
index 3151d9fe12..34ca504bb2 100644
--- a/src/lib/libcrypto/gost/gostr341194.c
+++ b/src/lib/libcrypto/gost/gostr341194.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gostr341194.c,v 1.2 2014/11/09 23:06:52 miod Exp $ */ 1/* $OpenBSD: gostr341194.c,v 1.3 2014/12/07 16:33:51 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
4 * Copyright (c) 2005-2006 Cryptocom LTD 4 * Copyright (c) 2005-2006 Cryptocom LTD
@@ -207,7 +207,8 @@ GOSTR341194_Init(GOSTR341194_CTX *c, int nid)
207} 207}
208 208
209static void 209static void
210GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const void *p, size_t num) 210GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const unsigned char *p,
211 size_t num)
211{ 212{
212 int i; 213 int i;
213 214
diff --git a/src/lib/libcrypto/gost/streebog.c b/src/lib/libcrypto/gost/streebog.c
index 4e49201c2d..8060161d11 100644
--- a/src/lib/libcrypto/gost/streebog.c
+++ b/src/lib/libcrypto/gost/streebog.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: streebog.c,v 1.3 2014/12/07 16:07:56 miod Exp $ */ 1/* $OpenBSD: streebog.c,v 1.4 2014/12/07 16:33:51 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
4 * Copyright (c) 2005-2006 Cryptocom LTD 4 * Copyright (c) 2005-2006 Cryptocom LTD
@@ -1269,7 +1269,8 @@ streebog_single_block(STREEBOG_CTX *ctx, const unsigned char *in, size_t num)
1269 1269
1270 1270
1271static void 1271static void
1272streebog_block_data_order(STREEBOG_CTX *ctx, const void *in, size_t num) 1272streebog_block_data_order(STREEBOG_CTX *ctx, const unsigned char *in,
1273 size_t num)
1273{ 1274{
1274 int i; 1275 int i;
1275 1276
@@ -1280,12 +1281,12 @@ streebog_block_data_order(STREEBOG_CTX *ctx, const void *in, size_t num)
1280int 1281int
1281STREEBOG512_Final(unsigned char *md, STREEBOG_CTX *c) 1282STREEBOG512_Final(unsigned char *md, STREEBOG_CTX *c)
1282{ 1283{
1283 int n;
1284 unsigned char *p = (unsigned char *)c->data; 1284 unsigned char *p = (unsigned char *)c->data;
1285 STREEBOG_LONG64 Z[STREEBOG_LBLOCK] = {}; 1285 STREEBOG_LONG64 Z[STREEBOG_LBLOCK] = {0};
1286 int n;
1286 1287
1287 if (c->num == STREEBOG_CBLOCK) { 1288 if (c->num == STREEBOG_CBLOCK) {
1288 streebog_block_data_order(c, c->data, 1); 1289 streebog_block_data_order(c, p, 1);
1289 c->num -= STREEBOG_CBLOCK; 1290 c->num -= STREEBOG_CBLOCK;
1290 } 1291 }
1291 1292