change bzero to memset
authorJohn Kohl <jtkohl@mit.edu>
Thu, 8 Nov 1990 17:46:52 +0000 (17:46 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 8 Nov 1990 17:46:52 +0000 (17:46 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1447 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/do_as_req.c
src/kdc/do_tgs_req.c
src/kdc/kdc_util.c
src/kdc/main.c
src/kdc/network.c

index f220ed0429fe4ea9d6fd143e02e7f55ac85be111..5a65823e1ac109867dd376c3ddfaff755b4cce42 100644 (file)
@@ -146,7 +146,8 @@ krb5_data **response;                       /* filled in with a response packet */
 #undef cleanup
 #define cleanup() {krb5_db_free_principal(&client, 1); \
                   krb5_db_free_principal(&server, 1); \
-                  bzero((char *)session_key->contents, session_key->length); \
+                  memset((char *)session_key->contents, 0, \
+                         session_key->length); \
                   free((char *)session_key->contents); \
                   session_key->contents = 0; }
 
@@ -239,7 +240,7 @@ krb5_data **response;                       /* filled in with a response packet */
        return retval;
     }
     retval = krb5_encrypt_tkt_part(&encrypting_key, &ticket_reply);
-    bzero((char *)encrypting_key.contents, encrypting_key.length);
+    memset((char *)encrypting_key.contents, 0, encrypting_key.length);
     free((char *)encrypting_key.contents);
     if (retval) {
        cleanup();
@@ -250,10 +251,11 @@ krb5_data **response;                     /* filled in with a response packet */
 
 #undef cleanup
 #define cleanup() {krb5_db_free_principal(&client, 1); \
-                  bzero((char *)session_key->contents, session_key->length); \
+                  memset((char *)session_key->contents, 0, \
+                         session_key->length); \
                   free((char *)session_key->contents); \
                   session_key->contents = 0; \
-                  bzero(ticket_reply.enc_part.ciphertext.data, \
+                  memset(ticket_reply.enc_part.ciphertext.data, 0, \
                         ticket_reply.enc_part.ciphertext.length); \
                   free(ticket_reply.enc_part.ciphertext.data);}
 
@@ -293,7 +295,7 @@ krb5_data **response;                       /* filled in with a response packet */
     }
     retval = krb5_encode_kdc_rep(KRB5_AS_REP, &reply_encpart,
                                 &encrypting_key,  &reply, response);
-    bzero((char *)encrypting_key.contents, encrypting_key.length);
+    memset((char *)encrypting_key.contents, 0, encrypting_key.length);
     free((char *)encrypting_key.contents);
     cleanup();
     return retval;
index 3fada1029b069e72eb1a499a69e4cf328032718c..bd791c3edee8fd62e7a49b8a722dc07afbb05ca1 100644 (file)
@@ -175,7 +175,8 @@ krb5_data **response;                       /* filled in with a response packet */
 #undef cleanup
 #define cleanup() { krb5_free_ticket(header_ticket); \
                   krb5_db_free_principal(&server, 1); \
-                  bzero((char *)session_key->contents, session_key->length); \
+                  memset((char *)session_key->contents, 0, \
+                         session_key->length); \
                   free((char *)session_key->contents); \
                   session_key->contents = 0; }
 
@@ -372,7 +373,8 @@ krb5_data **response;                       /* filled in with a response packet */
 #undef cleanup
 #define cleanup() { krb5_free_ticket(header_ticket); \
                   krb5_db_free_principal(&server, 1); \
-                  bzero((char *)session_key->contents, session_key->length); \
+                  memset((char *)session_key->contents, 0, \
+                         session_key->length); \
                   free((char *)session_key->contents); \
                   session_key->contents = 0; \
                   if (newtransited) free(enc_tkt_reply.transited.data);}
@@ -404,7 +406,7 @@ krb5_data **response;                       /* filled in with a response packet */
 
        retval = krb5_encrypt_tkt_part(&encrypting_key, &ticket_reply);
 
-       bzero((char *)encrypting_key.contents, encrypting_key.length);
+       memset((char *)encrypting_key.contents, 0, encrypting_key.length);
        free((char *)encrypting_key.contents);
 
        if (retval) {
@@ -443,7 +445,7 @@ krb5_data **response;                       /* filled in with a response packet */
     retval = krb5_encode_kdc_rep(KRB5_TGS_REP, &reply_encpart,
                                 header_ticket->enc_part2->session,
                                 &reply, response);
-    bzero((char *)session_key->contents, session_key->length);
+    memset((char *)session_key->contents, 0, session_key->length);
     free((char *)session_key->contents);
     session_key->contents = 0;
     return retval;
index e99f086561cd88e0569f6f41115bed6943fd3eb5..b70b0efa4340ecefb04abae6596b3df52fb444a9 100644 (file)
@@ -199,7 +199,7 @@ krb5_ticket **ticket;
                                 0,     /* no replay cache */
                                 &authdat);
     krb5_db_free_principal(&server, nprincs);
-    bzero((char *)encrypting_key.contents, encrypting_key.length);
+    memset((char *)encrypting_key.contents, 0, encrypting_key.length);
     free((char *)encrypting_key.contents);
     if (retval) {
        cleanup_apreq();
index d422b25bb9b8b1241e191be44bdd0240470fd14a..c77e12373015b7349dae48cb8c5d0c2ff49add09 100644 (file)
@@ -271,7 +271,7 @@ closedown_db()
     /* clean up master key stuff */
     retval = krb5_finish_key(&master_encblock);
 
-    bzero((char *)&master_encblock, sizeof(master_encblock));
+    memset((char *)&master_encblock, 0, sizeof(master_encblock));
 
     /* close database */
     if (retval) {
index 2d18ef3c228d1b453bb955bc1cbb88498e3853c0..07141a459ae4fa2e71387d6f6b5ea06099c19943 100644 (file)
@@ -57,7 +57,7 @@ const char *prog;
        com_err(prog, 0, "Cannot create server socket");
        return retval;
     }
-    bzero((char *)&sin, sizeof(sin));
+    memset((char *)&sin, 0, sizeof(sin));
     sin.sin_port = sp->s_port;
     if (bind(udp_port_fd, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
        retval = errno;