krb5int_yarrow_cipher_final before zeroing out reference to
memory.
* ycipher.[ch] (krb5int_yarrow_cipher_final): Free CIPHER_CTX memory
allocated by krb5int_yarrpw_cipher_init().
These cleanup handlers are now invoked in the library "fini" handlers.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16368
dc483132-0cff-0310-8789-
dd5450dbe970
+2004-05-26 Ezra Peisach <epeisach@mit.edu>
+
+ * yarrow.c (krb5int_yarrow_final): Call
+ krb5int_yarrow_cipher_final before zeroing out reference to
+ memory.
+
+ * ycipher.[ch] (krb5int_yarrow_cipher_final): Free CIPHER_CTX memory
+ allocated by krb5int_yarrpw_cipher_init().
+
2003-07-22 Ken Raeburn <raeburn@mit.edu>
* ycipher.c (krb5int_yarrow_cipher_init): Use keybytes and
CATCH:
if ( locked ) { TRY( UNLOCK() ); }
+ krb5int_yarrow_cipher_final(&y->cipher);
mem_zero( y, sizeof(Yarrow_CTX) );
EXCEP_RET;
}
return YARROW_OK;
}
+void
+krb5int_yarrow_cipher_final
+(CIPHER_CTX *ctx)
+
+{
+ if (ctx->key.contents) {
+ memset (ctx->key.contents, 0, ctx->key.length);
+ free (ctx->key.contents);
+ }
+ ctx->key.contents = 0;
+ ctx->key.length = 0;
+}
int krb5int_yarrow_cipher_init (CIPHER_CTX *ctx, unsigned const char *key);
int krb5int_yarrow_cipher_encrypt_block
(CIPHER_CTX *ctx, const unsigned char *in, unsigned char *out);
+void krb5int_yarrow_cipher_final (CIPHER_CTX *ctx);
#if !defined( YARROW_NO_MATHLIB )
#define POW_CIPHER_KEY_SIZE pow(2.0, CIPHER_KEY_SIZE * 8 / 3.0)