use the internal sequence-numbering code
authorJohn Kohl <jtkohl@mit.edu>
Fri, 1 Mar 1991 15:44:56 +0000 (15:44 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 1 Mar 1991 15:44:56 +0000 (15:44 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1832 dc483132-0cff-0310-8789-dd5450dbe970

src/slave/kprop.c
src/slave/kpropd.c

index 45ae9b2607cbdabb58ac48038d31bada0eb6083b..05351df42d4a9340b3ca5083db2b151f87f983d9 100644 (file)
@@ -53,8 +53,8 @@ krb5_principal        my_principal;           /* The Kerberos principal we'll be */
                                /* get_tickets() */
 krb5_ccache    ccache;         /* Credentials cache which we'll be using */
 krb5_creds     my_creds;       /* My credentials */
-int            my_seq_num;     /* Sequence number to use for connection */
-int            his_seq_num;    /* Remote sequence number */
+krb5_int32     my_seq_num;     /* Sequence number to use for connection */
+krb5_int32     his_seq_num;    /* Remote sequence number */
 krb5_address   sender_addr;
 krb5_address   receiver_addr;
 
@@ -350,15 +350,8 @@ void kerberos_authenticate(fd, me)
        krb5_ap_rep_enc_part    *rep_result;
        struct timeval  mytime;
 
-       /*
-        * Generate a random key to use as a sequence number
-        */
-       gettimeofday(&mytime, NULL);
-       srandom(mytime.tv_usec ^ mytime.tv_sec ^ (9 * getpid()));
-       my_seq_num = random();
-       
        if (retval = krb5_sendauth(fd, kprop_version, me, my_creds.server,
-                                   AP_OPTS_MUTUAL_REQUIRED, my_seq_num, NULL,
+                                   AP_OPTS_MUTUAL_REQUIRED, &my_seq_num, NULL,
                                    NULL, &my_creds, NULL, &error,
                                    &rep_result)) {
                com_err(progname, retval, "while authenticating to server");
index 002ad5b4b290f0c94a5be04027ece0870a7b1212..6691ddf87d27b0331232c7253a123ce20b92b297 100644 (file)
@@ -70,8 +70,8 @@ char  *kdb5_edit = KPROPD_DEFAULT_KDB5_EDIT;
 char   *kerb_database = KPROPD_DEFAULT_KRB_DB;
 
 int            database_fd;
-int            my_seq_num;     /* Sequence number */
-int            his_seq_num;    /* The remote's sequence number */
+krb5_int32     my_seq_num;     /* Sequence number */
+krb5_int32     his_seq_num;    /* The remote's sequence number */
 krb5_address   sender_addr;
 krb5_address   receiver_addr;
 
@@ -204,12 +204,7 @@ void doit(fd)
                if (debug)
                        printf("Connection from %s\n", hp->h_name);
        }
-       /*
-        * Create a random number for my sequence number.
-        */
-       gettimeofday(&my_time, NULL);
-       srandom(my_time.tv_usec ^ my_time.tv_sec ^ (9 * getpid()));
-       my_seq_num = random();
+
        /*
         * Now do the authentication
         */
@@ -500,7 +495,7 @@ kerberos_authenticate(fd, clientp, sin)
               sizeof(r_sin.sin_addr));
        
        if (retval = krb5_recvauth(fd, kprop_version, server, &sender_addr,
-                                  kerb_keytab, NULL, NULL, my_seq_num,
+                                  kerb_keytab, NULL, NULL, &my_seq_num,
                                   "dfl", clientp, &ticket, &authent)) {
                syslog(LOG_ERR, "Error in krb5_recvauth: %s",
                       error_message(retval));