change bzero to memset
authorJohn Kohl <jtkohl@mit.edu>
Thu, 8 Nov 1990 17:16:20 +0000 (17:16 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 8 Nov 1990 17:16:20 +0000 (17:16 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1440 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/des/cbc_cksum.c
src/lib/crypto/des/enc_dec.c
src/lib/crypto/des/fin_rndkey.c
src/lib/crypto/des/finish_key.c
src/lib/crypto/des/init_rkey.c
src/lib/crypto/des/new_rn_key.c
src/lib/crypto/des/string2key.c

index f5526760c715fa1cbdfdb258d622ec29dd6fb40d..39988441a0f1319965513194f8f115a6725d17bc 100644 (file)
@@ -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)) {
index cee05883ba705dc42b237cdd70474fca96a18b3a..7123baaa73dda32dcfebf83e930c717e37cb8e42 100644 (file)
@@ -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,
index 3696b545c9615673fc73b6550b1e1219682e1ca6..21b3bea8fc75e3fccb0d37e37f2d63ad91043de3 100644 (file)
@@ -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 */
index 3269597e60e2794ae4afccb4f0bed6eb48ffaf5d..52982311b09670d04ed884c844b3e83d1ebd4d8e 100644 (file)
@@ -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? */
index c37d1f96aaaf20e4835505b312dfc66ccc40b19c..dabc8b00cadbef64decbf6a1d1bb59ace7746373 100644 (file)
@@ -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;
index c7603b7efbc0653b1aa1ec5182f1dba536d8c0f0..3e72740a3c7ea2ed3d6ce4aa70a9df91d82030da 100644 (file)
@@ -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));
index 36d7e07c619a8f85528ed9f3c88a10d905042c02..d505aeddae13d1c4bf9cccee37bd70772b42b096 100644 (file)
@@ -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);