change bcopy to memcpy, memset to bzero
authorJohn Kohl <jtkohl@mit.edu>
Thu, 8 Nov 1990 15:57:07 +0000 (15:57 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 8 Nov 1990 15:57:07 +0000 (15:57 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1437 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/copy_addrs.c
src/lib/krb5/krb/copy_auth.c
src/lib/krb5/krb/copy_data.c
src/lib/krb5/krb/copy_key.c
src/lib/krb5/krb/mk_priv.c
src/lib/krb5/krb/rd_priv.c

index bae5b547ca1382465d1c431831e2e3d412a27b83..c20ee39ec8495f1bec63270feec000cf8e5e3a61 100644 (file)
@@ -34,7 +34,7 @@ krb5_address **outad;
        xfree(tmpad);
        return ENOMEM;
     }
-    bcopy((char *)inad->contents, (char *)tmpad->contents, inad->length);
+    memcpy((char *)tmpad->contents, (char *)inad->contents, inad->length);
     *outad = tmpad;
     return 0;
 }
index 98d660f6012997eebd986789b9fee1dcba469e82..7febd59b318aeb38f8f5b648cc2c3ca322ca1876 100644 (file)
@@ -34,7 +34,7 @@ krb5_authdata **outad;
        xfree(tmpad);
        return ENOMEM;
     }
-    bcopy((char *)inad->contents, (char *)tmpad->contents, inad->length);
+    memcpy((char *)tmpad->contents, (char *)inad->contents, inad->length);
     *outad = tmpad;
     return 0;
 }
index 671e3720d598c4de16c4e71c7c60d3aaf3b6e17c..3e17ce563152a71127116e3da84051e5421871b1 100644 (file)
@@ -37,7 +37,7 @@ krb5_data **outdata;
        free((char *)tempdata);
        return ENOMEM;
     }
-    bcopy((char *)indata->data, (char *)tempdata->data, tempdata->length);
+    memcpy((char *)tempdata->data, (char *)indata->data, tempdata->length);
     *outdata = tempdata;
     return 0;
 }
index 94a26d8e5a0929016c190a38ea853d180fbb6b8e..f3aec81aa979f4f1f2ab686312b563510539c72a 100644 (file)
@@ -31,6 +31,6 @@ krb5_keyblock *to;
     to->contents = (krb5_octet *)malloc(to->length);
     if (!to->contents)
        return ENOMEM;
-    bcopy((char *)from->contents, (char *)to->contents, to->length);
+    memcpy((char *)to->contents, (char *)from->contents, to->length);
     return 0;
 }
index 3a182cf8b10d4b259da3c725b6331724338ac5c9..420f208d5f1de8cc0525dba290a396a0aa3d4a9a 100644 (file)
@@ -85,7 +85,7 @@ OLDDECLARG(krb5_data *, outbuf)
     if (retval = encode_krb5_enc_priv_part(&privmsg_enc_part, &scratch))
        return retval;
 
-#define cleanup_scratch() { (void) bzero(scratch->data, scratch->length); krb5_free_data(scratch); }
+#define cleanup_scratch() { (void) memset(scratch->data, 0, scratch->length); krb5_free_data(scratch); }
 
     /* put together an eblock for this encryption */
 
@@ -99,7 +99,7 @@ OLDDECLARG(krb5_data *, outbuf)
        xfree(scratch);
        return ENOMEM;
     }
-    bzero(scratch->data + scratch->length,
+    memset(scratch->data + scratch->length, 0,
          privmsg.enc_part.ciphertext.length - scratch->length);
     if (!(privmsg.enc_part.ciphertext.data =
          malloc(privmsg.enc_part.ciphertext.length))) {
@@ -108,7 +108,7 @@ OLDDECLARG(krb5_data *, outbuf)
     }
 
 #define cleanup_encpart() {\
-(void) bzero(privmsg.enc_part.ciphertext.data, \
+(void) memset(privmsg.enc_part.ciphertext.data, 0, \
             privmsg.enc_part.ciphertext.length); \
 free(privmsg.enc_part.ciphertext.data); \
 privmsg.enc_part.ciphertext.length = 0; privmsg.enc_part.ciphertext.data = 0;}
@@ -128,13 +128,14 @@ privmsg.enc_part.ciphertext.length = 0; privmsg.enc_part.ciphertext.data = 0;}
         goto clean_prockey;
     }
 
+
     /* put last block into the i_vector */
     if (i_vector)
-       bcopy(privmsg.enc_part.ciphertext.data +
-             (privmsg.enc_part.ciphertext.length -
-              eblock.crypto_entry->block_length),
-             i_vector,
-             eblock.crypto_entry->block_length);
+       memcpy(i_vector,
+              privmsg.enc_part.ciphertext.data +
+              (privmsg.enc_part.ciphertext.length -
+               eblock.crypto_entry->block_length),
+              eblock.crypto_entry->block_length);
           
     /* private message is now assembled-- do some cleanup */
     cleanup_scratch();
index 24d04001353923a2736144561500b2d086b0e33b..94b8d82d6297f1ef20cd69e841702fb276578e72 100644 (file)
@@ -91,7 +91,7 @@ OLDDECLARG(krb5_data *, outbuf)
         return ENOMEM;
     }
 
-#define cleanup_scratch() {(void)bzero(scratch.data, scratch.length); (void)xfree(scratch.data);}
+#define cleanup_scratch() {(void)memset(scratch.data, 0, scratch.length); (void)xfree(scratch.data);}
 
     /* do any necessary key pre-processing */
     if (retval = krb5_process_key(&eblock, key)) {
@@ -117,11 +117,11 @@ OLDDECLARG(krb5_data *, outbuf)
        input */
     /* put last block into the i_vector */
     if (i_vector)
-       bcopy(privmsg->enc_part.ciphertext.data +
-             (privmsg->enc_part.ciphertext.length -
-              eblock.crypto_entry->block_length),
-             i_vector,
-             eblock.crypto_entry->block_length);
+       memcpy(i_vector,
+              privmsg->enc_part.ciphertext.data +
+              (privmsg->enc_part.ciphertext.length -
+               eblock.crypto_entry->block_length),
+              eblock.crypto_entry->block_length);
 
     /* private message is now decrypted -- do some cleanup */
 
@@ -139,7 +139,7 @@ OLDDECLARG(krb5_data *, outbuf)
     }
     cleanup_scratch();
 
-#define cleanup_data() {(void)bzero(privmsg_enc_part->user_data.data,privmsg_enc_part->user_data.length); (void)xfree(privmsg_enc_part->user_data.data);}
+#define cleanup_data() {(void)memset(privmsg_enc_part->user_data.data,0,privmsg_enc_part->user_data.length); (void)xfree(privmsg_enc_part->user_data.data);}
 #define cleanup_mesg() {(void)xfree(privmsg_enc_part);}
 
     if (retval = krb5_timeofday(&currenttime)) {