password[truncate[i]] = 0;
ka_StringToKey (password, "andy.edu", &key);
ka_ReadBytes (answer[i], &correct_key, sizeof(key));
- if (bcmp (&key, &correct_key, sizeof(key)) != 0) {
+ if (memcmp (&key, &correct_key, sizeof(key)) != 0) {
printf ("String to key error converting '%s'; should be '%s' instead got '",
password, answer[i]);
ka_PrintBytes (&key, sizeof(key));
exit (1);
}
}
- bzero (password, sizeof(password));
+ memset(password, 0, sizeof(password));
j=0; /* current password length */
for (i=(sizeof(truncate)/sizeof(int))-1; i>=0; i--) {
while (j<truncate[i]) {
}
ka_StringToKey (password, "andy.edu", &key);
ka_ReadBytes (answer[i], &correct_key, sizeof(key));
- if (bcmp (&key, &correct_key, sizeof(key)) != 0) {
+ if (memcmp (&key, &correct_key, sizeof(key)) != 0) {
printf ("String to key error converting '%s'; should be '%s' instead got '",
password, answer[i]);
ka_PrintBytes (&key, sizeof(key));
{ struct ktc_encryptionKey badkey;
- bcopy (&key, &badkey, sizeof(badkey));
+ memcpy(&badkey, &key, sizeof(badkey));
*(int *)&badkey ^= 1; /* toggle some bit */
code = ubik_Call (KAM_SetPassword, conn, 0, name, inst, 0, badkey);
if (code != KABADKEY) {
com_err (whoami, code, "Trying to set bad key");
exit(1);
}
- bzero (&badkey, sizeof(badkey));
+ memset(&badkey, 0, sizeof(badkey));
code = ubik_Call (KAM_SetPassword, conn, 0, name, inst, 0, badkey);
if (code != KABADKEY) goto abort_5;
code = ubik_Call (KAM_SetPassword, conn, 0, name, inst, 9999, key);
code = ubik_Call (KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &entry);
if (code) goto abort_3;
- if (bcmp (&tentry, &entry, sizeof(entry)) != 0) {
+ if (memcmp (&tentry, &entry, sizeof(entry)) != 0) {
printf ("Entries obtained not the same!\n");
print_entry (&entry, name, inst);
}
}
/* try bashing a ticket to make sure it fails to work */
- bzero (atoken.ticket+10, 1);
+ memset(atoken.ticket+10, 0, 1);
code = ka_AuthServerConn (localCell, KA_MAINTENANCE_SERVICE, &atoken, &conn);
if (code) {
com_err (whoami, code, "contacting admin server with bashed ticket");