summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/engines
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2014-04-10 22:39:22 +0000
committerjkim <jkim@FreeBSD.org>2014-04-10 22:39:22 +0000
commitaeb5a4ff70fa036e3502afc9daf7d02795216340 (patch)
treec5b5657bc6509d897204957128bcbeac4535b4b7 /crypto/openssl/engines
parent8f4a94c1c91787a4ac5272d05fa061275e720a27 (diff)
downloadFreeBSD-src-aeb5a4ff70fa036e3502afc9daf7d02795216340.zip
FreeBSD-src-aeb5a4ff70fa036e3502afc9daf7d02795216340.tar.gz
MFC: r261037, r264278
Merge OpenSSL 1.0.1f and 1.0.1g.
Diffstat (limited to 'crypto/openssl/engines')
-rw-r--r--crypto/openssl/engines/ccgost/gost89.h4
-rw-r--r--crypto/openssl/engines/ccgost/gosthash.c19
2 files changed, 9 insertions, 14 deletions
diff --git a/crypto/openssl/engines/ccgost/gost89.h b/crypto/openssl/engines/ccgost/gost89.h
index 2157852..8da2407 100644
--- a/crypto/openssl/engines/ccgost/gost89.h
+++ b/crypto/openssl/engines/ccgost/gost89.h
@@ -87,10 +87,6 @@ extern gost_subst_block Gost28147_CryptoProParamSetB;
extern gost_subst_block Gost28147_CryptoProParamSetC;
extern gost_subst_block Gost28147_CryptoProParamSetD;
extern const byte CryptoProKeyMeshingKey[];
-#if __LONG_MAX__ > 2147483647L
typedef unsigned int word32;
-#else
-typedef unsigned long word32;
-#endif
#endif
diff --git a/crypto/openssl/engines/ccgost/gosthash.c b/crypto/openssl/engines/ccgost/gosthash.c
index 8c278aa..91b2ce8 100644
--- a/crypto/openssl/engines/ccgost/gosthash.c
+++ b/crypto/openssl/engines/ccgost/gosthash.c
@@ -180,8 +180,6 @@ int start_hash(gost_hash_ctx *ctx)
*/
int hash_block(gost_hash_ctx *ctx,const byte *block, size_t length)
{
- const byte *curptr=block;
- const byte *barrier=block+(length-32);/* Last byte we can safely hash*/
if (ctx->left)
{
/*There are some bytes from previous step*/
@@ -196,24 +194,25 @@ int hash_block(gost_hash_ctx *ctx,const byte *block, size_t length)
{
return 1;
}
- curptr=block+add_bytes;
+ block+=add_bytes;
+ length-=add_bytes;
hash_step(ctx->cipher_ctx,ctx->H,ctx->remainder);
add_blocks(32,ctx->S,ctx->remainder);
ctx->len+=32;
ctx->left=0;
}
- while (curptr<=barrier)
+ while (length>=32)
{
- hash_step(ctx->cipher_ctx,ctx->H,curptr);
+ hash_step(ctx->cipher_ctx,ctx->H,block);
- add_blocks(32,ctx->S,curptr);
+ add_blocks(32,ctx->S,block);
ctx->len+=32;
- curptr+=32;
+ block+=32;
+ length-=32;
}
- if (curptr!=block+length)
+ if (length)
{
- ctx->left=block+length-curptr;
- memcpy(ctx->remainder,curptr,ctx->left);
+ memcpy(ctx->remainder,block,ctx->left=length);
}
return 1;
}
OpenPOWER on IntegriCloud