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

src/lib/krb425/get_cred.c
src/lib/krb425/mk_priv.c
src/lib/krb425/mk_req.c
src/lib/krb425/mk_safe.c
src/lib/krb425/rd_priv.c
src/lib/krb425/rd_req.c
src/lib/krb425/rd_safe.c
src/lib/krb425/recvauth.c
src/lib/krb425/sendauth.c
src/lib/krb425/set_key.c

index 21b3d31f88b71fdd92ded9cd85f007f2c22993f7..03fef28df1988c93094b5fa5d72d987a743888db 100644 (file)
@@ -86,13 +86,12 @@ CREDENTIALS *c;
        set_string(c->instance, REALM_SZ, creds.server[2]);
 
        c->ticket_st.length = creds.ticket.length;
-       bcopy(creds.ticket.data,
-             c->ticket_st.dat,
-             min(c->ticket_st.length, MAX_KTXT_LEN));
+       memcpy(c->ticket_st.dat,
+              creds.ticket.data,
+              min(c->ticket_st.length, MAX_KTXT_LEN));
        c->ticket_st.mbz = 0;
 
-       bcopy(creds.keyblock.contents,
-             (char*)c->session, sizeof(C_Block));
+       memcpy((char*)c->session, creds.keyblock.contents, sizeof(C_Block));
 
        c->issue_date = creds.times.starttime;
        c->lifetime = creds.times.endtime;
index 9adc184d10b20be47f92a80108a4a14fec4dd2aa..84372c8a3f94b2b0cdef0827faec63cf81a07755 100644 (file)
@@ -50,8 +50,8 @@ struct sockaddr_in *receiver;
        raddr.length = 4;
        raddr.contents = (krb5_octet *)ra;
 
-       bcopy((char *)&sender->sin_addr, sa, 4);
-       bcopy((char *)&receiver->sin_addr, ra, 4);
+       memcpy(sa, (char *)&sender->sin_addr, 4);
+       memcpy(ra, (char *)&receiver->sin_addr, 4);
 
        sfaddr.address = &saddr;
        sfaddr.port = sender->sin_port;
@@ -73,7 +73,7 @@ struct sockaddr_in *receiver;
                return(-1);
        }
 
-       bcopy(out5.data, out, out5.length);
+       memcpy(out, out5.data, out5.length);
        free(out5.data);
        return(out5.length);
 }
index 755bfd85f1c160981638b007ba63b4489cce08fe..30ec9daf2333928390afef28fa3a1a1f9ccbee08 100644 (file)
@@ -72,7 +72,7 @@ u_long checksum;
                        return(KFAILURE);
                }
                authent->length = outbuf.length;
-               bcopy((char *)outbuf.data, (char *)authent->dat, outbuf.length);
+               memcpy((char *)authent->dat, (char *)outbuf.data, outbuf.length);
                free((char *)outbuf.data);
        }
        return(krb425error(r));
index 2a2fc66d1a454d544f30ae916579b20f8fdd532b..59cda767989e814c8f57822939e7a164c77b58e0 100644 (file)
@@ -49,8 +49,8 @@ struct sockaddr_in *receiver;
        raddr.length = 4;
        raddr.contents = (krb5_octet *)ra;
 
-       bcopy((char *)&sender->sin_addr, sa, 4);
-       bcopy((char *)&receiver->sin_addr, ra, 4);
+       memcpy(sa, (char *)&sender->sin_addr, sa, 4);
+       memcpy(ra, (char *)&receiver->sin_addr, 4);
 
        sfaddr.address = &saddr;
        sfaddr.port = sender->sin_port;
@@ -72,7 +72,7 @@ struct sockaddr_in *receiver;
                return(-1);
        }
 
-       bcopy(out5.data, out, out5.length);
+       memcpy(out, out5.data, out5.length);
        free(out5.data);
        return(out5.length);
 }
index cda7f5e25472d941f2625de6f6ec18cba8deed07..0b4af57f5e353314f81b273db826e778215cad08 100644 (file)
@@ -50,8 +50,8 @@ MSG_DAT *msg;
        raddr.length = 4;
        raddr.contents = (krb5_octet *)ra;
 
-       bcopy((char *)&sender->sin_addr, sa, 4);
-       bcopy((char *)&receiver->sin_addr, ra, 4);
+       memcpy(sa, (char *)&sender->sin_addr, 4);
+       memcpy(ra, (char *)&receiver->sin_addr, 4);
 
        sfaddr.address = &saddr;
        sfaddr.port = sender->sin_port;
index ad62f2addaacbacff3401c65fb0ba682a21ad3a8..05b949ded8e1cb8af2cbf80458b2243b4384264f 100644 (file)
@@ -41,7 +41,7 @@ char *fn;
                peer.addrtype = ADDRTYPE_INET;
                peer.length = 4;
                peer.contents = (krb5_octet *)addr;
-               bcopy((char *)&from_addr + (sizeof(from_addr) - 4), addr, 4);
+               memcpy(addr, (char *)&from_addr + (sizeof(from_addr) - 4), 4);
        }
 
        if (!_krb425_local_realm[0])
@@ -143,8 +143,9 @@ char *fn;
                r = KFAILURE;
                goto out;
        } else
-               bcopy(authd.ticket->enc_part2->session->contents,
-                     (char*)ad->session, sizeof(C_Block));
+               memcpy((char*)ad->session,
+                      authd.ticket->enc_part2->session->contents,
+                      sizeof(C_Block));
 
        ad->life = authd.ticket->enc_part2->times.endtime;
        ad->time_sec = authd.authenticator->ctime;
@@ -154,15 +155,15 @@ char *fn;
                r = KFAILURE;
                goto out;
        } else
-               bcopy(authd.ticket->enc_part2->caddrs[0]->contents, 
-                     (char *)&ad->address + sizeof(ad->address) - 4, 4);
+               memcpy((char *)&ad->address + sizeof(ad->address) - 4,
+                      authd.ticket->enc_part2->caddrs[0]->contents, 4);
 
        if (authd.ticket->enc_part2->authorization_data &&
            authd.ticket->enc_part2->authorization_data[0]) {
                ad->reply.length = authd.ticket->enc_part2->authorization_data[0]->length;
-               bcopy(authd.ticket->enc_part2->authorization_data[0]->contents,
-                     ad->reply.dat,
-                     min(ad->reply.length, MAX_KTXT_LEN));
+               memcpy(ad->reply.dat,
+                      authd.ticket->enc_part2->authorization_data[0]->contents,
+                      min(ad->reply.length, MAX_KTXT_LEN));
                ad->reply.mbz = 0;
        }
 out:
index d2f55c60905c5b288c8382b67961c4dbef117937..9b50aabeb05afd020b285a7ecafebd865626efb0 100644 (file)
@@ -49,8 +49,8 @@ MSG_DAT *msg;
        raddr.length = 4;
        raddr.contents = (krb5_octet *)ra;
 
-       bcopy((char *)&sender->sin_addr, sa, 4);
-       bcopy((char *)&receiver->sin_addr, ra, 4);
+       memcpy(sa, (char *)&sender->sin_addr, 4);
+       memcpy(ra, (char *)&receiver->sin_addr, 4);
 
        sfaddr.address = &saddr;
        sfaddr.port = sender->sin_port;
index 1cee4884f9b97f5eaaa876b11b36b866a747a5d3..321c46170f96c47720b2b3ed2693d99591703d66 100644 (file)
@@ -146,7 +146,7 @@ char *version;                       /* version string (filled in) */
        old_vers = 1;
 
        /* copy what we have read into tmp_buf */
-       (void) bcopy(krb_vers, (char *) tmp_buf, KRB_SENDAUTH_VLEN);
+       (void) memcpy((char *) tmp_buf, krb_vers, KRB_SENDAUTH_VLEN);
 
        /* search for space, and make it a null */
        for (i = 0; i < KRB_SENDAUTH_VLEN; i++)
@@ -191,7 +191,7 @@ char *version;                       /* version string (filled in) */
        }
        ticket->length = tkt_len;
        /* copy the ticket into the struct */
-       (void) bcopy(cp, (char *) ticket->dat, ticket->length);
+       (void) memcpy((char *) ticket->dat, cp, ticket->length);
 
     } else {
        /* read the application version string */
index 9c050104e546ef2695f6ec42615d6d4470a7fd15..0a5394500e92dae4e2ff4a0947f254f294dac051 100644 (file)
@@ -161,7 +161,7 @@ char *version;                       /* version string */
            return(cc);
 
     /* zero the buffer */
-    (void) bzero(buf, BUFSIZ);
+    (void) memset(buf, 0, BUFSIZ);
 
     /* insert version strings */
     (void) strncpy(buf, KRB_SENDAUTH_VERS, KRB_SENDAUTH_VLEN);
@@ -172,11 +172,11 @@ char *version;                     /* version string */
 
     /* put ticket length into buffer */
     tkt_len = htonl((unsigned long) ticket->length);
-    (void) bcopy((char *) &tkt_len, buf+i, sizeof(tkt_len));
+    (void) memcpy(buf+i, (char *) &tkt_len, sizeof(tkt_len));
     i += sizeof(tkt_len);
 
     /* put ticket into buffer */
-    (void) bcopy((char *) ticket->dat, buf+i, ticket->length);
+    (void) memcpy(buf+i, (char *) ticket->dat, ticket->length);
     i += ticket->length;
 
     /* write the request to the server */
@@ -214,8 +214,8 @@ char *version;                       /* version string */
            return(cc);
 
        /* fetch the (modified) checksum */
-       (void) bcopy((char *)msg_data->app_data, (char *)&cksum,
-                    sizeof(cksum));
+       (void) memcpy((char *)&cksum, (char *)msg_data->app_data,
+                     sizeof(cksum));
        cksum = ntohl(cksum);
 
        /* if it doesn't match, fail */
index 8c4a70d86a3184509721ffaf598998b94faee0d8..4589f7b8d1b0f9125f3b15a95ab0944407e3c33e 100644 (file)
@@ -36,7 +36,7 @@ int cvt;
                }
                keyblock.length = 8;
                keyblock.keytype = KEYTYPE_DES;
-               bcopy(key, keyblock.contents,8);
+               memcpy(keyblock.contents, key, 8);
        }
        return(KSUCCESS);
 }