From: John Kohl Date: Thu, 8 Nov 1990 17:16:20 +0000 (+0000) Subject: change bzero to memset X-Git-Tag: krb5-1.0-alpha3~153 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bd7c25d1bfd093b7b8dd7f4df88f572b513b4a83;p=krb5.git change bzero to memset git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1440 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/des/cbc_cksum.c b/src/lib/crypto/des/cbc_cksum.c index f5526760c..39988441a 100644 --- a/src/lib/crypto/des/cbc_cksum.c +++ b/src/lib/crypto/des/cbc_cksum.c @@ -57,7 +57,7 @@ OLDDECLARG(krb5_checksum *, cksum) if (!(schedule = (struct mit_des_ks_struct *) malloc(sizeof(mit_des_key_schedule)))) return ENOMEM; -#define cleanup() { bzero((char *)schedule, sizeof(mit_des_key_schedule));\ +#define cleanup() { memset((char *)schedule, 0, sizeof(mit_des_key_schedule));\ free( (char *) schedule); } switch (mit_des_key_sched ((krb5_octet *)key, schedule)) { diff --git a/src/lib/crypto/des/enc_dec.c b/src/lib/crypto/des/enc_dec.c index cee05883b..7123baaa7 100644 --- a/src/lib/crypto/des/enc_dec.c +++ b/src/lib/crypto/des/enc_dec.c @@ -105,7 +105,7 @@ OLDDECLARG(krb5_pointer, ivec) p = (char *)in + sumsize - CRC32_CKSUM_LENGTH; endinput = (char *)in + size; - bzero(endinput, sumsize - size); + memset(endinput, 0, sumsize - size); cksum.contents = contents; if (retval = (*krb5_cksumarray[CKSUMTYPE_CRC32]-> @@ -188,7 +188,7 @@ OLDDECLARG(krb5_pointer, ivec) cksum.contents = contents_prd; p = (char *)out + size - CRC32_CKSUM_LENGTH; memcpy((char *)contents_get, p, CRC32_CKSUM_LENGTH); - bzero(p, CRC32_CKSUM_LENGTH); + memset(p, 0, CRC32_CKSUM_LENGTH); if (retval = (*krb5_cksumarray[CKSUMTYPE_CRC32]-> sum_func)(out, diff --git a/src/lib/crypto/des/fin_rndkey.c b/src/lib/crypto/des/fin_rndkey.c index 3696b545c..21b3bea8f 100644 --- a/src/lib/crypto/des/fin_rndkey.c +++ b/src/lib/crypto/des/fin_rndkey.c @@ -26,7 +26,7 @@ static char rcsid_fin_rndkey_c[] = krb5_error_code mit_des_finish_random_key (DECLARG(krb5_pointer *, seed)) OLDDECLARG(krb5_pointer *, seed) { - bzero( (char *)*seed, sizeof(mit_des_random_key_seed) ); + memset((char *)*seed, 0, sizeof(mit_des_random_key_seed) ); free((char *)*seed); *seed = 0; return 0; /* XXX init_random_key */ diff --git a/src/lib/crypto/des/finish_key.c b/src/lib/crypto/des/finish_key.c index 3269597e6..52982311b 100644 --- a/src/lib/crypto/des/finish_key.c +++ b/src/lib/crypto/des/finish_key.c @@ -30,7 +30,7 @@ static char rcsid_finish_key_c[] = krb5_error_code mit_des_finish_key (DECLARG(krb5_encrypt_block *,eblock)) OLDDECLARG(krb5_encrypt_block *,eblock) { - bzero((char *)eblock->priv, sizeof(mit_des_key_schedule)); + memset((char *)eblock->priv, 0, sizeof(mit_des_key_schedule)); free(eblock->priv); eblock->priv = 0; /* free/clear other stuff here? */ diff --git a/src/lib/crypto/des/init_rkey.c b/src/lib/crypto/des/init_rkey.c index c37d1f96a..dabc8b00c 100644 --- a/src/lib/crypto/des/init_rkey.c +++ b/src/lib/crypto/des/init_rkey.c @@ -39,7 +39,7 @@ OLDDECLARG(krb5_pointer *,seed) if ( !(p_seed = (mit_des_random_key_seed *) malloc(sizeof(mit_des_random_key_seed))) ) return ENOMEM; - bzero( (char *)p_seed, sizeof(mit_des_random_key_seed) ); + memset((char *)p_seed, 0, sizeof(mit_des_random_key_seed) ); mit_des_init_random_number_generator(seedblock->contents, p_seed); *seed = (krb5_pointer) p_seed; return 0; diff --git a/src/lib/crypto/des/new_rn_key.c b/src/lib/crypto/des/new_rn_key.c index c7603b7ef..3e72740a3 100644 --- a/src/lib/crypto/des/new_rn_key.c +++ b/src/lib/crypto/des/new_rn_key.c @@ -87,7 +87,7 @@ void mit_des_init_random_number_generator(key,p_seed) * use a host id in generating the seed to ensure * that different servers have different streams: */ - bzero((char *)seed, sizeof(seed)); + memset((char *)seed, 0, sizeof(seed)); if (!krb5_os_localaddr(&addrs) && *addrs) { memcpy((char *)seed, (char *)addrs[0]->contents, min(sizeof(seed), addrs[0]->length)); diff --git a/src/lib/crypto/des/string2key.c b/src/lib/crypto/des/string2key.c index 36d7e07c6..d505aedda 100644 --- a/src/lib/crypto/des/string2key.c +++ b/src/lib/crypto/des/string2key.c @@ -74,14 +74,14 @@ OLDDECLARG(krb5_const_principal, princ) if ( !(keyblock->contents = (krb5_octet *)malloc(sizeof(mit_des_cblock))) ) return(ENOMEM); -#define cleanup() {bzero(keyblock->contents, sizeof(mit_des_cblock));\ +#define cleanup() {memset(keyblock->contents, 0, sizeof(mit_des_cblock));\ (void) free((char *) keyblock->contents);} keyblock->keytype = KEYTYPE_DES; keyblock->length = sizeof(mit_des_cblock); key = keyblock->contents; - bzero(copystr, sizeof(copystr)); + memset(copystr, 0, sizeof(copystr)); j = min(data->length, 511); (void) strncpy(copystr, data->data, j); if ( princ != 0 ) @@ -97,7 +97,7 @@ OLDDECLARG(krb5_const_principal, princ) length = strlen(str); /* init key array for bits */ - bzero(k_char,sizeof(k_char)); + memset(k_char,0,sizeof(k_char)); #ifdef DEBUG if (mit_des_debug) @@ -146,7 +146,7 @@ OLDDECLARG(krb5_const_principal, princ) (void) mit_des_key_sched(key, key_sked); (void) mit_des_cbc_cksum((krb5_octet *)copystr, key, length, key_sked, key); /* erase key_sked */ - bzero((char *)key_sked, sizeof(key_sked)); + memset((char *)key_sked, 0, sizeof(key_sked)); /* now fix up key parity again */ mit_des_fixup_key_parity(key);