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

Diff for /src/usr.bin/ssh/Attic/bufaux.c between version 1.35.2.2 and 1.41

version 1.35.2.2, 2006/02/03 02:53:44 version 1.41, 2006/03/30 09:58:15
Line 1 
Line 1 
   /* $OpenBSD$ */
 /*  /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>   * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland   * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
Line 37 
Line 38 
  */   */
   
 #include "includes.h"  #include "includes.h"
 RCSID("$OpenBSD$");  
   
 #include <openssl/bn.h>  #include <openssl/bn.h>
 #include "bufaux.h"  #include "bufaux.h"
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "getput.h"  
 #include "log.h"  #include "log.h"
   #include "misc.h"
   
 /*  /*
  * Stores an BIGNUM in the buffer with a 2-byte msb first bit count, followed   * Stores an BIGNUM in the buffer with a 2-byte msb first bit count, followed
Line 68 
Line 68 
         }          }
   
         /* Store the number of bits in the buffer in two bytes, msb first. */          /* Store the number of bits in the buffer in two bytes, msb first. */
         PUT_16BIT(msg, bits);          put_u16(msg, bits);
         buffer_append(buffer, msg, 2);          buffer_append(buffer, msg, 2);
         /* Store the binary data. */          /* Store the binary data. */
         buffer_append(buffer, (char *)buf, oi);          buffer_append(buffer, buf, oi);
   
         memset(buf, 0, bin_size);          memset(buf, 0, bin_size);
         xfree(buf);          xfree(buf);
Line 100 
Line 100 
                 error("buffer_get_bignum_ret: invalid length");                  error("buffer_get_bignum_ret: invalid length");
                 return (-1);                  return (-1);
         }          }
         bits = GET_16BIT(buf);          bits = get_u16(buf);
         /* Compute the number of binary bytes that follow. */          /* Compute the number of binary bytes that follow. */
         bytes = (bits + 7) / 8;          bytes = (bits + 7) / 8;
         if (bytes > 8 * 1024) {          if (bytes > 8 * 1024) {
Line 219 
Line 219 
   
         if (buffer_get_ret(buffer, (char *) buf, 2) == -1)          if (buffer_get_ret(buffer, (char *) buf, 2) == -1)
                 return (-1);                  return (-1);
         *ret = GET_16BIT(buf);          *ret = get_u16(buf);
         return (0);          return (0);
 }  }
   
Line 241 
Line 241 
   
         if (buffer_get_ret(buffer, (char *) buf, 4) == -1)          if (buffer_get_ret(buffer, (char *) buf, 4) == -1)
                 return (-1);                  return (-1);
         *ret = GET_32BIT(buf);          *ret = get_u32(buf);
         return (0);          return (0);
 }  }
   
Line 263 
Line 263 
   
         if (buffer_get_ret(buffer, (char *) buf, 8) == -1)          if (buffer_get_ret(buffer, (char *) buf, 8) == -1)
                 return (-1);                  return (-1);
         *ret = GET_64BIT(buf);          *ret = get_u64(buf);
         return (0);          return (0);
 }  }
   
Line 286 
Line 286 
 {  {
         char buf[2];          char buf[2];
   
         PUT_16BIT(buf, value);          put_u16(buf, value);
         buffer_append(buffer, buf, 2);          buffer_append(buffer, buf, 2);
 }  }
   
Line 295 
Line 295 
 {  {
         char buf[4];          char buf[4];
   
         PUT_32BIT(buf, value);          put_u32(buf, value);
         buffer_append(buffer, buf, 4);          buffer_append(buffer, buf, 4);
 }  }
   
Line 304 
Line 304 
 {  {
         char buf[8];          char buf[8];
   
         PUT_64BIT(buf, value);          put_u64(buf, value);
         buffer_append(buffer, buf, 8);          buffer_append(buffer, buf, 8);
 }  }
   

Legend:
Removed from v.1.35.2.2  
changed lines
  Added in v.1.41