[BACK]Return to hostfile.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/hostfile.c between version 1.2 and 1.3

version 1.2, 1999/09/28 04:45:36 version 1.3, 1999/10/03 21:50:03
Line 168 
Line 168 
 HostStatus  HostStatus
 check_host_in_hostfile(const char *filename,  check_host_in_hostfile(const char *filename,
                        const char *host, unsigned int bits,                         const char *host, unsigned int bits,
                        BIGNUM *e, BIGNUM *n)                         BIGNUM *e, BIGNUM *n,
                          BIGNUM *ke, BIGNUM *kn)
 {  {
   FILE *f;    FILE *f;
   char line[8192];    char line[8192];
Line 176 
Line 177 
   char *cp, *cp2;    char *cp, *cp2;
   HostStatus end_return;    HostStatus end_return;
   struct stat st;    struct stat st;
   BIGNUM *ke, *kn;  
   
   /* Open the file containing the list of known hosts. */    /* Open the file containing the list of known hosts. */
   f = fopen(filename, "r");    f = fopen(filename, "r");
Line 190 
Line 190 
       return HOST_NEW;        return HOST_NEW;
     }      }
   
   /* Initialize mp-int variables. */  
   ke = BN_new();  
   kn = BN_new();  
   
   /* Cache the length of the host name. */    /* Cache the length of the host name. */
   hostlen = strlen(host);    hostlen = strlen(host);
   
Line 235 
Line 231 
       if (kbits == bits && BN_cmp(ke, e) == 0 && BN_cmp(kn, n) == 0)        if (kbits == bits && BN_cmp(ke, e) == 0 && BN_cmp(kn, n) == 0)
         {          {
           /* Ok, they match. */            /* Ok, they match. */
           BN_clear_free(ke);  
           BN_clear_free(kn);  
           fclose(f);            fclose(f);
           return HOST_OK;            return HOST_OK;
         }          }
Line 246 
Line 240 
       end_return = HOST_CHANGED;        end_return = HOST_CHANGED;
     }      }
   /* Clear variables and close the file. */    /* Clear variables and close the file. */
   BN_clear_free(ke);  
   BN_clear_free(kn);  
   fclose(f);    fclose(f);
   
   /* Return either HOST_NEW or HOST_CHANGED, depending on whether we saw a    /* Return either HOST_NEW or HOST_CHANGED, depending on whether we saw a

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3