From: John Kohl Date: Thu, 8 Nov 1990 15:57:07 +0000 (+0000) Subject: change bcopy to memcpy, memset to bzero X-Git-Tag: krb5-1.0-alpha3~155 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=38885ea7b95a19e7354cdf6c9f0e07cce3cfd512;p=krb5.git change bcopy to memcpy, memset to bzero git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1437 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/copy_addrs.c b/src/lib/krb5/krb/copy_addrs.c index bae5b547c..c20ee39ec 100644 --- a/src/lib/krb5/krb/copy_addrs.c +++ b/src/lib/krb5/krb/copy_addrs.c @@ -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; } diff --git a/src/lib/krb5/krb/copy_auth.c b/src/lib/krb5/krb/copy_auth.c index 98d660f60..7febd59b3 100644 --- a/src/lib/krb5/krb/copy_auth.c +++ b/src/lib/krb5/krb/copy_auth.c @@ -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; } diff --git a/src/lib/krb5/krb/copy_data.c b/src/lib/krb5/krb/copy_data.c index 671e3720d..3e17ce563 100644 --- a/src/lib/krb5/krb/copy_data.c +++ b/src/lib/krb5/krb/copy_data.c @@ -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; } diff --git a/src/lib/krb5/krb/copy_key.c b/src/lib/krb5/krb/copy_key.c index 94a26d8e5..f3aec81aa 100644 --- a/src/lib/krb5/krb/copy_key.c +++ b/src/lib/krb5/krb/copy_key.c @@ -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; } diff --git a/src/lib/krb5/krb/mk_priv.c b/src/lib/krb5/krb/mk_priv.c index 3a182cf8b..420f208d5 100644 --- a/src/lib/krb5/krb/mk_priv.c +++ b/src/lib/krb5/krb/mk_priv.c @@ -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(); diff --git a/src/lib/krb5/krb/rd_priv.c b/src/lib/krb5/krb/rd_priv.c index 24d040013..94b8d82d6 100644 --- a/src/lib/krb5/krb/rd_priv.c +++ b/src/lib/krb5/krb/rd_priv.c @@ -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(¤ttime)) {