diff options
| author | Doug Barton <dougb@FreeBSD.org> | 2010-03-02 19:49:55 +0000 | 
|---|---|---|
| committer | Doug Barton <dougb@FreeBSD.org> | 2010-03-02 19:49:55 +0000 | 
| commit | 841024d54f1f0a07feccf84d8938b00bc1f362b5 (patch) | |
| tree | c470abc978aa6ca4f6b0033d7e09c8b7b09cd629 /lib/isc/sha2.c | |
| parent | 51917575cfd35d6a201b010726ea7404a0f9bb7e (diff) | |
Diffstat (limited to 'lib/isc/sha2.c')
| -rw-r--r-- | lib/isc/sha2.c | 27 | 
1 files changed, 24 insertions, 3 deletions
| diff --git a/lib/isc/sha2.c b/lib/isc/sha2.c index 70eea4f96700a..ff19274837a65 100644 --- a/lib/isc/sha2.c +++ b/lib/isc/sha2.c @@ -1,5 +1,5 @@  /* - * Copyright (C) 2005-2007, 2009  Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2005-2007, 2009, 2010  Internet Systems Consortium, Inc. ("ISC")   *   * Permission to use, copy, modify, and/or distribute this software for any   * purpose with or without fee is hereby granted, provided that the above @@ -14,7 +14,7 @@   * PERFORMANCE OF THIS SOFTWARE.   */ -/* $Id: sha2.c,v 1.13.332.2 2009/01/18 23:47:41 tbox Exp $ */ +/* $Id: sha2.c,v 1.13.332.4 2010/01/15 23:47:34 tbox Exp $ */  /*	$FreeBSD$	*/  /*	$KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $	*/ @@ -415,6 +415,11 @@ isc_sha224_init(isc_sha224_t *context) {  }  void +isc_sha224_invalidate(isc_sha224_t *context) { +	memset(context, 0, sizeof(isc_sha224_t)); +} + +void  isc_sha224_update(isc_sha224_t *context, const isc_uint8_t* data, size_t len) {  	isc_sha256_update((isc_sha256_t *)context, data, len);  } @@ -651,6 +656,11 @@ isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) {  #endif /* ISC_SHA2_UNROLL_TRANSFORM */  void +isc_sha256_invalidate(isc_sha256_t *context) { +	memset(context, 0, sizeof(isc_sha256_t)); +} + +void  isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) {  	unsigned int	freespace, usedspace; @@ -990,7 +1000,13 @@ isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) {  #endif /* ISC_SHA2_UNROLL_TRANSFORM */ -void isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) { +void +isc_sha512_invalidate(isc_sha512_t *context) { +	memset(context, 0, sizeof(isc_sha512_t)); +} + +void +isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) {  	unsigned int	freespace, usedspace;  	if (len == 0U) { @@ -1164,6 +1180,11 @@ isc_sha384_init(isc_sha384_t *context) {  }  void +isc_sha384_invalidate(isc_sha384_t *context) { +	memset(context, 0, sizeof(isc_sha384_t)); +} + +void  isc_sha384_update(isc_sha384_t *context, const isc_uint8_t* data, size_t len) {  	isc_sha512_update((isc_sha512_t *)context, data, len);  } | 
