~ubuntu-branches/ubuntu/precise/dropbear/precise

« back to all changes in this revision

Viewing changes to libtomcrypt/src/pk/asn1/der/ia5/der_encode_ia5_string.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape
  • Date: 2007-03-02 20:48:18 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070302204818-ozmbou2sbyj7dus5
Tags: 0.49-1
* new upstream release, fixes
  * CVE-2007-1099: dropbear dbclient insufficient warning on hostkey
    mismatch (closes: #412899).
  * dbclient uses static "Password:" prompt instead of using the server's
    prompt (closes: #394996).
* debian/control: Suggests: openssh-client, not ssh (closes: #405686);
  Standards-Version: 3.7.2.2.
* debian/README.Debian: ssh -> openssh-server, openssh-client; remove
  'Replacing OpenSSH "sshd" with Dropbear' part, this is simply done by not
  installing the openssh-server package.
* debian/README.runit: runsvstat -> sv status.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * The library is free for all purposes without any express
7
7
 * guarantee it works.
8
8
 *
9
 
 * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org
 
9
 * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
10
10
 */
11
11
#include "tomcrypt.h"
12
12
 
42
42
 
43
43
   /* too big? */
44
44
   if (len > *outlen) {
 
45
      *outlen = len;
45
46
      return CRYPT_BUFFER_OVERFLOW;
46
47
   }
47
48
 
49
50
   x = 0;
50
51
   out[x++] = 0x16;
51
52
   if (inlen < 128) {
52
 
      out[x++] = inlen;
 
53
      out[x++] = (unsigned char)inlen;
53
54
   } else if (inlen < 256) {
54
55
      out[x++] = 0x81;
55
 
      out[x++] = inlen;
 
56
      out[x++] = (unsigned char)inlen;
56
57
   } else if (inlen < 65536UL) {
57
58
      out[x++] = 0x82;
58
 
      out[x++] = (inlen>>8)&255;
59
 
      out[x++] = inlen&255;
 
59
      out[x++] = (unsigned char)((inlen>>8)&255);
 
60
      out[x++] = (unsigned char)(inlen&255);
60
61
   } else if (inlen < 16777216UL) {
61
62
      out[x++] = 0x83;
62
 
      out[x++] = (inlen>>16)&255;
63
 
      out[x++] = (inlen>>8)&255;
64
 
      out[x++] = inlen&255;
 
63
      out[x++] = (unsigned char)((inlen>>16)&255);
 
64
      out[x++] = (unsigned char)((inlen>>8)&255);
 
65
      out[x++] = (unsigned char)(inlen&255);
65
66
   } else {
66
67
      return CRYPT_INVALID_ARG;
67
68
   }
80
81
#endif
81
82
 
82
83
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/ia5/der_encode_ia5_string.c,v $ */
83
 
/* $Revision: 1.1 $ */
84
 
/* $Date: 2005/05/16 15:08:11 $ */
 
84
/* $Revision: 1.4 $ */
 
85
/* $Date: 2006/12/04 21:34:03 $ */