Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 133 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
131 magnus 1
Description: Support Nettle 3.x
2
Author: Magnus Holmgren <holmgren@debian.org>
3
Forwarded: yes
4
 
5
--- a/src/spki/verify.c
6
+++ b/src/spki/verify.c
7
@@ -25,7 +25,7 @@
8
 #endif
9
 
10
 #include <nettle/bignum.h>
11
-#include <nettle/dsa.h>
12
+#include <nettle/dsa-compat.h>
13
 #include <nettle/rsa.h>
14
 
15
 #include "certificate.h"
16
@@ -74,7 +74,7 @@ spki_verify_dsa(const uint8_t *digest,
17
   dsa_public_key_init(&dsa);
18
   dsa_signature_init(&rs);
19
 
20
-  res = (dsa_keypair_from_sexp_alist(&dsa, NULL,
21
+  res = (dsa_keypair_from_sexp_alist((struct dsa_public_key *)&dsa, dsa.y, NULL,
22
                                     RSA_KEYSIZE_LIMIT, DSA_SHA1_Q_BITS, &key->sexp)
23
         && spki_parse_type(key)
24
         && dsa_signature_from_sexp(&rs, &signature->sexp, DSA_SHA1_Q_BITS)
25
--- a/src/crypto.c
26
+++ b/src/crypto.c
27
@@ -322,7 +322,7 @@ make_cast128_cbc_instance(struct crypto_
28
                        ? do_cast128_encrypt
29
                        : do_cast128_decrypt);
30
 
31
-  cast128_set_key(&self->ctx.ctx, algorithm->key_size, key);
32
+  cast5_set_key(&self->ctx.ctx, algorithm->key_size, key);
33
   CBC_SET_IV(&self->ctx, iv);
34
 
35
   return(&self->super);
36
--- a/src/dsa.c
37
+++ b/src/dsa.c
38
@@ -28,7 +28,7 @@
39
 #include <assert.h>
40
 
41
 #include <nettle/bignum.h>
42
-#include <nettle/dsa.h>
43
+#include <nettle/dsa-compat.h>
44
 #include <nettle/sexp.h>
45
 #include <nettle/sha.h>
46
 
47
@@ -322,7 +322,7 @@ make_dsa_verifier(struct signature_algor
48
   NEW(dsa_verifier, res);
49
   init_dsa_verifier(res);
50
 
51
-  if (dsa_keypair_from_sexp_alist(&res->key, NULL, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
52
+  if (dsa_keypair_from_sexp_alist((struct dsa_params *)&res->key, res->key.y, NULL, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
53
     return &res->super;
54
 
55
   KILL(res);
56
@@ -341,7 +341,7 @@ make_dsa_signer(struct signature_algorit
57
 
58
   dsa_private_key_init(&res->key);
59
 
60
-  if (dsa_keypair_from_sexp_alist(&verifier->key, &res->key, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
61
+  if (dsa_keypair_from_sexp_alist((struct dsa_params *)&verifier->key, verifier->key.y, res->key.x, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
62
     {
63
       res->random = self->random;
64
       res->verifier = verifier;
65
--- a/src/dummy.c
66
+++ b/src/dummy.c
67
@@ -41,84 +41,84 @@
68
 #include "lsh.h"
69
 
70
 /* Referenced by ssh_format.c */
71
-unsigned
72
+size_t
73
 nettle_mpz_sizeinbase_256_s(const mpz_t x UNUSED)
74
 { abort(); }
75
 
76
-unsigned
77
+size_t
78
 nettle_mpz_sizeinbase_256_u(const mpz_t x UNUSED)
79
 { abort(); }
80
 
81
 void
82
-cbc_encrypt(void *ctx UNUSED, nettle_crypt_func f UNUSED,
83
-           unsigned block_size UNUSED, uint8_t *iv UNUSED,
84
-           unsigned length UNUSED, uint8_t *dst UNUSED,
85
+cbc_encrypt(const void *ctx UNUSED, nettle_cipher_func *f UNUSED,
86
+           size_t block_size UNUSED, uint8_t *iv UNUSED,
87
+           size_t length UNUSED, uint8_t *dst UNUSED,
88
            const uint8_t *src UNUSED)
89
 { abort(); }
90
 
91
 void
92
-cbc_decrypt(void *ctx UNUSED, nettle_crypt_func f UNUSED,
93
-           unsigned block_size UNUSED, uint8_t *iv UNUSED,
94
-           unsigned length UNUSED, uint8_t *dst UNUSED,
95
+cbc_decrypt(const void *ctx UNUSED, nettle_cipher_func *f UNUSED,
96
+           size_t block_size UNUSED, uint8_t *iv UNUSED,
97
+           size_t length UNUSED, uint8_t *dst UNUSED,
98
            const uint8_t *src UNUSED)
99
 { abort(); }
100
 
101
 void
102
-ctr_crypt(void *ctx UNUSED, nettle_crypt_func f UNUSED,
103
-         unsigned block_size UNUSED, uint8_t *iv UNUSED,
104
-         unsigned length UNUSED, uint8_t *dst UNUSED,
105
+ctr_crypt(const void *ctx UNUSED, nettle_cipher_func *f UNUSED,
106
+         size_t block_size UNUSED, uint8_t *iv UNUSED,
107
+         size_t length UNUSED, uint8_t *dst UNUSED,
108
          const uint8_t *src UNUSED)
109
 { abort(); }
110
 
111
 void
112
 hmac_digest(const void *outer UNUSED, const void *inner UNUSED, void *state UNUSED,
113
            const struct nettle_hash *hash UNUSED,
114
-           unsigned length UNUSED, uint8_t *digest UNUSED)
115
+           size_t length UNUSED, uint8_t *digest UNUSED)
116
 { abort(); }
117
 
118
-unsigned
119
+size_t
120
 sexp_vformat(struct nettle_buffer *buffer UNUSED,
121
             const char *format UNUSED, va_list args UNUSED)
122
 { abort(); }
123
 
124
-unsigned
125
+size_t
126
 sexp_transport_vformat(struct nettle_buffer *buffer UNUSED,
127
                       const char *format UNUSED, va_list args UNUSED)
128
 { abort(); }
129
 
130
 int
131
 sexp_transport_iterator_first(struct sexp_iterator *iterator UNUSED,
132
-                             unsigned length UNUSED, uint8_t *input UNUSED)
133
+                             size_t length UNUSED, uint8_t *input UNUSED)
134
 { abort(); }
135
 
136
 void
137
 nettle_buffer_init_size(struct nettle_buffer *buffer UNUSED,
138
-                       unsigned length UNUSED, uint8_t *space UNUSED)
139
+                       size_t length UNUSED, uint8_t *space UNUSED)
140
 
141
 { abort(); }
142
 
143
 
144
 /* Referenced by lsh_string.c */
145
-uint8_t *
146
-memxor(uint8_t *dst UNUSED, const uint8_t *src UNUSED, size_t n UNUSED)
147
+void *
148
+memxor(void *dst UNUSED, const void *src UNUSED, size_t n UNUSED)
149
 { abort(); }
150
 
151
 void
152
-nettle_mpz_get_str_256(unsigned length UNUSED, uint8_t *s UNUSED, const mpz_t x UNUSED)
153
+nettle_mpz_get_str_256(size_t length UNUSED, uint8_t *s UNUSED, const mpz_t x UNUSED)
154
 { abort(); }
155
 
156
 void
157
 base64_encode_init(struct base64_encode_ctx *ctx UNUSED)
158
 { abort(); }
159
 
160
-unsigned
161
+size_t
162
 base64_encode_update(struct base64_encode_ctx *ctx UNUSED,
163
                     uint8_t *dst UNUSED,
164
-                    unsigned length UNUSED,
165
+                    size_t length UNUSED,
166
                     const uint8_t *src UNUSED)
167
 { abort(); }
168
 
169
-unsigned
170
+size_t
171
 base64_encode_final(struct base64_encode_ctx *ctx UNUSED,
172
                    uint8_t *dst UNUSED)
173
 { abort(); }
174
@@ -129,9 +129,9 @@ base64_decode_init(struct base64_decode_
175
 
176
 int
177
 base64_decode_update(struct base64_decode_ctx *ctx UNUSED,
178
-                    unsigned *dst_length UNUSED,
179
+                    size_t *dst_length UNUSED,
180
                     uint8_t *dst UNUSED,
181
-                    unsigned src_length UNUSED,
182
+                    size_t src_length UNUSED,
183
                     const uint8_t *src UNUSED)
184
 { abort(); }
185
 
186
@@ -142,7 +142,7 @@ base64_decode_final(struct base64_decode
187
 /* Referenced by parse.c */
188
 void
189
 nettle_mpz_set_str_256_s(mpz_t x UNUSED,
190
-                        unsigned length UNUSED, const uint8_t *s UNUSED)
191
+                        size_t length UNUSED, const uint8_t *s UNUSED)
192
 { abort(); }
193
 
194
 /* Referenced by werror.c */
195
--- a/src/lsh-keygen.c
196
+++ b/src/lsh-keygen.c
197
@@ -39,7 +39,7 @@
198
 #include <unistd.h>
199
 #endif
200
 
201
-#include <nettle/dsa.h>
202
+#include <nettle/dsa-compat.h>
203
 #include <nettle/rsa.h>
204
 
205
 #include "crypto.h"
206
@@ -214,7 +214,7 @@ dsa_generate_key(struct randomness *r, u
207
 
208
   assert(r->quality == RANDOM_GOOD);
209
 
210
-  if (dsa_generate_keypair(&public, &private,
211
+  if (dsa_compat_generate_keypair(&public, &private,
212
                           r, lsh_random,
213
                           NULL, progress,
214
                           512 + 64 * level, DSA_SHA1_Q_BITS))