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)) {
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]->
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,
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 */
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? */
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;
* 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));
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 )
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)
(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);