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

« back to all changes in this revision

Viewing changes to libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_multi.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
#include <stdarg.h>
19
19
 
20
20
#ifdef LTC_DER
21
21
 
 
22
/**
 
23
  Encode a SEQUENCE type using a VA list
 
24
  @param out    [out] Destination for data
 
25
  @param outlen [in/out] Length of buffer and resulting length of output
 
26
  @remark <...> is of the form <type, size, data> (int, unsigned long, void*)
 
27
  @return CRYPT_OK on success
 
28
*/  
22
29
int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...)
23
30
{
24
31
   int           err, type;
43
50
       }
44
51
 
45
52
       switch (type) {
 
53
           case LTC_ASN1_BOOLEAN:
46
54
           case LTC_ASN1_INTEGER:
47
55
           case LTC_ASN1_SHORT_INTEGER:
48
56
           case LTC_ASN1_BIT_STRING:
51
59
           case LTC_ASN1_OBJECT_IDENTIFIER:
52
60
           case LTC_ASN1_IA5_STRING:
53
61
           case LTC_ASN1_PRINTABLE_STRING:
 
62
           case LTC_ASN1_UTF8_STRING:
54
63
           case LTC_ASN1_UTCTIME:
55
64
           case LTC_ASN1_SEQUENCE:
 
65
           case LTC_ASN1_SET:
 
66
           case LTC_ASN1_SETOF:
56
67
                ++x; 
57
68
                break;
58
69
          
86
97
       }
87
98
 
88
99
       switch (type) {
 
100
           case LTC_ASN1_BOOLEAN:
89
101
           case LTC_ASN1_INTEGER:
90
102
           case LTC_ASN1_SHORT_INTEGER:
91
103
           case LTC_ASN1_BIT_STRING:
94
106
           case LTC_ASN1_OBJECT_IDENTIFIER:
95
107
           case LTC_ASN1_IA5_STRING:
96
108
           case LTC_ASN1_PRINTABLE_STRING:
 
109
           case LTC_ASN1_UTF8_STRING:
97
110
           case LTC_ASN1_UTCTIME:
98
111
           case LTC_ASN1_SEQUENCE:
 
112
           case LTC_ASN1_SET:
 
113
           case LTC_ASN1_SETOF:
99
114
                list[x].type   = type;
100
115
                list[x].size   = size;
101
116
                list[x++].data = data;
119
134
 
120
135
 
121
136
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_multi.c,v $ */
122
 
/* $Revision: 1.6 $ */
123
 
/* $Date: 2005/06/18 19:20:23 $ */
 
137
/* $Revision: 1.11 $ */
 
138
/* $Date: 2006/11/26 02:25:18 $ */