free(scratch.data);
return retval;
}
-#define clean_scratch() {bzero(scratch.data, scratch.length); free(scratch.data);}
+#define clean_scratch() {memset(scratch.data, 0, scratch.length); \
+free(scratch.data);}
if (retval = krb5_finish_key(&eblock)) {
clean_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 */
xfree(scratch);
return ENOMEM;
}
- bzero(scratch->data + scratch->length,
+ memset(scratch->data + scratch->length, 0,
dec_rep->enc_part.ciphertext.length - scratch->length);
if (!(dec_rep->enc_part.ciphertext.data =
malloc(dec_rep->enc_part.ciphertext.length))) {
}
#define cleanup_encpart() { \
-(void) bzero(dec_rep->enc_part.ciphertext.data, \
+(void) memset(dec_rep->enc_part.ciphertext.data, 0, \
dec_rep->enc_part.ciphertext.length); \
free(dec_rep->enc_part.ciphertext.data); \
dec_rep->enc_part.ciphertext.length = 0; \
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 */
xfree(scratch);
return ENOMEM;
}
- bzero(scratch->data + scratch->length,
+ memset(scratch->data + scratch->length, 0,
dec_ticket->enc_part.ciphertext.length - scratch->length);
if (!(dec_ticket->enc_part.ciphertext.data =
malloc(dec_ticket->enc_part.ciphertext.length))) {
}
#define cleanup_encpart() {\
-(void) bzero(dec_ticket->enc_part.ciphertext.data, \
+(void) memset(dec_ticket->enc_part.ciphertext.data, 0,\
dec_ticket->enc_part.ciphertext.length); \
free(dec_ticket->enc_part.ciphertext.data); \
dec_ticket->enc_part.ciphertext.length = 0; \
* XXX we're sharing some substructure here, which is
* probably not safe...
*/
- bzero((char *)&tgtq, sizeof(tgtq));
+ memset((char *)&tgtq, 0, sizeof(tgtq));
tgtq.client = cred->client;
if (retval = krb5_tgtname(krb5_princ_realm(cred->client),
goto out;
}
/* now get the TGTs */
- bzero((char *)&tgtq, sizeof(tgtq));
+ memset((char *)&tgtq, 0, sizeof(tgtq));
tgtq.times = tgt.times;
tgtq.client = tgt.client;
tgtq.server = *next_server;
return retval;
#undef cleanup
#define cleanup() {\
- bzero((char *)dec_rep->enc_part2->session->contents,\
+ memset((char *)dec_rep->enc_part2->session->contents, 0,\
dec_rep->enc_part2->session->length);\
krb5_free_kdc_rep(dec_rep); }
cleanup();
return retval;
}
- bzero((char *)dec_rep->enc_part2->session->contents,
+ memset((char *)dec_rep->enc_part2->session->contents, 0,
dec_rep->enc_part2->session->length);
#undef cleanup
#define cleanup() {\
- bzero((char *)cred->keyblock.contents, cred->keyblock.length);\
+ memset((char *)cred->keyblock.contents, 0, cred->keyblock.length);\
krb5_free_kdc_rep(dec_rep); }
cred->times = dec_rep->enc_part2->times;
krb5_creds mcreds;
krb5_flags fields;
- bzero((char *)&mcreds, sizeof(mcreds));
+ memset((char *)&mcreds, 0, sizeof(mcreds));
mcreds.server = creds->server;
mcreds.client = creds->client;
mcreds.times.endtime = creds->times.endtime;
}
retval = (*decrypt_proc)(decrypt_key, decryptarg, as_reply);
- bzero((char *)decrypt_key->contents, decrypt_key->length);
+ memset((char *)decrypt_key->contents, 0, decrypt_key->length);
krb5_free_keyblock(decrypt_key);
if (retval) {
krb5_free_kdc_rep(as_reply);
(request.till != 0) &&
(as_reply->enc_part2->times.renew_till > request.till))
) {
- bzero((char *)as_reply->enc_part2->session->contents,
+ memset((char *)as_reply->enc_part2->session->contents, 0,
as_reply->enc_part2->session->length);
krb5_free_kdc_rep(as_reply);
return KRB5_KDCREP_MODIFIED;
/* fill in the credentials */
if (retval = krb5_copy_keyblock(as_reply->enc_part2->session,
&creds->keyblock)) {
- bzero((char *)as_reply->enc_part2->session->contents,
+ memset((char *)as_reply->enc_part2->session->contents, 0,
as_reply->enc_part2->session->length);
krb5_free_kdc_rep(as_reply);
return retval;
}
-#define cleanup_key() {bzero((char *)creds->keyblock.contents, \
+#define cleanup_key() {memset((char *)creds->keyblock.contents, 0,\
creds->keyblock.length); \
free((char *)creds->keyblock.contents); \
creds->keyblock.contents = 0; \
free(scratch.data);
return retval;
}
-#define clean_scratch() {bzero(scratch.data, scratch.length); free(scratch.data);}
+#define clean_scratch() {memset(scratch.data, 0, scratch.length); \
+free(scratch.data);}
if (retval = krb5_finish_key(&eblock)) {
clean_scratch();
return retval;
if (retval = encode_krb5_ap_rep_enc_part(repl, &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 */
xfree(scratch);
return ENOMEM;
}
- bzero(scratch->data + scratch->length,
+ memset(scratch->data + scratch->length, 0,
reply.enc_part.ciphertext.length - scratch->length);
if (!(reply.enc_part.ciphertext.data =
malloc(reply.enc_part.ciphertext.length))) {
}
#define cleanup_encpart() {\
-(void) bzero(reply.enc_part.ciphertext.data, \
+(void) memset(reply.enc_part.ciphertext.data, 0,\
reply.enc_part.ciphertext.length); \
free(reply.enc_part.ciphertext.data); \
reply.enc_part.ciphertext.length = 0; reply.enc_part.ciphertext.data = 0;}
/* obtain ticket & session key */
- bzero((char *)&creds, sizeof(creds));
+ memset((char *)&creds, 0, sizeof(creds));
creds.server = (krb5_principal) server;
if (retval = krb5_cc_get_principal(ccache, &creds.client))
return(retval);
- /* creds.times.endtime = 0; -- bzero takes care of this
+ /* creds.times.endtime = 0; -- memset 0 takes care of this
zero means "as long as possible" */
/* creds.keyblock.keytype = 0; -- as well as this.
zero means no session keytype
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 */
retval = ENOMEM;
goto clean_ticket;
}
- bzero(scratch->data + scratch->length,
+ memset(scratch->data + scratch->length, 0,
request.authenticator.ciphertext.length - scratch->length);
if (!(request.authenticator.ciphertext.data =
malloc(request.authenticator.ciphertext.length))) {
}
#define cleanup_encpart() {\
-(void) bzero(request.authenticator.ciphertext.data, \
+(void) memset(request.authenticator.ciphertext.data, 0,\
request.authenticator.ciphertext.length); \
free(request.authenticator.ciphertext.data); \
request.authenticator.ciphertext.length = 0; \
if (retval = encode_krb5_safe(&safemsg, &scratch))
return retval;
-#define clean_scratch() {(void) bzero((char *)scratch->data, scratch->length); krb5_free_data(scratch);}
+#define clean_scratch() {(void) memset((char *)scratch->data, 0,\
+ scratch->length); \
+ krb5_free_data(scratch);}
if (!(safe_checksum.contents = (krb5_octet *)
malloc(krb5_cksumarray[sumtype]->checksum_length))) {
(void) krb5_finish_key(&eblock);
goto errout;
}
-#define clean_scratch() {bzero(scratch.data, scratch.length); free(scratch.data);}
+#define clean_scratch() {memset(scratch.data, 0, scratch.length); \
+free(scratch.data);}
/* finished with the top-level encoding of the ap_rep */
krb5_free_ap_rep(reply);
if (retval = krb5_finish_key(&eblock)) {
free(scratch.data);
return retval;
}
-#define clean_scratch() {bzero(scratch.data, scratch.length); free(scratch.data);}
+#define clean_scratch() {memset(scratch.data, 0, scratch.length); \
+free(scratch.data);}
if (retval = krb5_finish_key(&eblock)) {
clean_scratch();
(krb5_pointer) key->contents,
key->length,
&our_cksum);
- (void) bzero((char *)scratch->data, scratch->length);
+ (void) memset((char *)scratch->data, 0, scratch->length);
krb5_free_data(scratch);
if (retval) {
krb5_ticket *sec_ticket = 0;
krb5_ticket *sec_ticket_arr[2];
- bzero((char *)&tgsreq, sizeof(tgsreq));
+ memset((char *)&tgsreq, 0, sizeof(tgsreq));
tgsreq.kdc_options = kdcoptions;
tgsreq.server = (krb5_principal) sname;
if (setjmp(pwd_jump)) {
/* interrupted */
if (readin_string) {
- (void) bzero(readin_string, *size_return);
+ (void) memset(readin_string, 0, *size_return);
free(readin_string);
}
- (void) bzero(return_pwd, *size_return);
+ (void) memset(return_pwd, 0, *size_return);
cleanup(KRB5_LIBOS_PWDINTR);
}
/* save intrfunc */
/* put out the prompt */
(void) fputs(prompt,stdout);
(void) fflush(stdout);
- (void) bzero(return_pwd, *size_return);
+ (void) memset(return_pwd, 0, *size_return);
if (fgets(return_pwd, *size_return, stdin) == NULL) {
/* error */
(void) putchar('\n');
- (void) bzero(return_pwd, *size_return);
+ (void) memset(return_pwd, 0, *size_return);
cleanup(KRB5_LIBOS_CANTREADPWD);
}
(void) putchar('\n');
(void) fflush(stdout);
readin_string = malloc(*size_return);
if (!readin_string) {
- (void) bzero(return_pwd, *size_return);
+ (void) memset(return_pwd, 0, *size_return);
cleanup(ENOMEM);
}
- (void) bzero(readin_string, *size_return);
+ (void) memset(readin_string, 0, *size_return);
if (fgets(readin_string, *size_return, stdin) == NULL) {
/* error */
(void) putchar('\n');
- (void) bzero(readin_string, *size_return);
- (void) bzero(return_pwd, *size_return);
+ (void) memset(readin_string, 0, *size_return);
+ (void) memset(return_pwd, 0, *size_return);
free(readin_string);
cleanup(KRB5_LIBOS_CANTREADPWD);
}
/* compare */
if (strncmp(return_pwd, readin_string, *size_return)) {
- (void) bzero(readin_string, *size_return);
- (void) bzero(return_pwd, *size_return);
+ (void) memset(readin_string, 0, *size_return);
+ (void) memset(return_pwd, 0, *size_return);
free(readin_string);
cleanup(KRB5_LIBOS_BADPWDMATCH);
}
- (void) bzero(readin_string, *size_return);
+ (void) memset(readin_string, 0, *size_return);
free(readin_string);
}