MSVC6 related fixes (needed for older ActivePerl@MSWin32)
Karel Miko
7 years ago
223 | 223 | { |
224 | 224 | int rv; |
225 | 225 | unsigned long int out_len = 4096; |
226 | unsigned char out[out_len]; | |
226 | unsigned char out[4096]; | |
227 | 227 | |
228 | 228 | RETVAL = newSVpvn(NULL, 0); /* undef */ |
229 | 229 | if (strnEQ(type, "private", 7)) { |
251 | 251 | unsigned char *data_ptr=NULL; |
252 | 252 | STRLEN data_len=0; |
253 | 253 | unsigned long buffer_len = 1024; |
254 | unsigned char buffer[buffer_len]; | |
254 | unsigned char buffer[1024]; | |
255 | 255 | |
256 | 256 | data_ptr = (unsigned char *)SvPVbyte(data, data_len); |
257 | 257 | |
274 | 274 | unsigned char *data_ptr=NULL; |
275 | 275 | STRLEN data_len=0; |
276 | 276 | unsigned long buffer_len = 1024; |
277 | unsigned char buffer[buffer_len]; | |
277 | unsigned char buffer[1024]; | |
278 | 278 | |
279 | 279 | data_ptr = (unsigned char *)SvPVbyte(data, data_len); |
280 | 280 | |
293 | 293 | unsigned char *data_ptr=NULL; |
294 | 294 | STRLEN data_len=0; |
295 | 295 | unsigned long buffer_len = 1024; |
296 | unsigned char buffer[buffer_len]; | |
296 | unsigned char buffer[1024]; | |
297 | 297 | |
298 | 298 | data_ptr = (unsigned char *)SvPVbyte(data, data_len); |
299 | 299 | |
332 | 332 | { |
333 | 333 | int rv; |
334 | 334 | unsigned long buffer_len = 1024; |
335 | unsigned char buffer[buffer_len]; | |
335 | unsigned char buffer[1024]; | |
336 | 336 | |
337 | 337 | rv = dh_shared_secret(&self->key, &pubkey->key, buffer, &buffer_len); |
338 | 338 | if (rv != CRYPT_OK) croak("FATAL: dh_shared_secret failed: %s", error_to_string(rv)); |
345 | 345 | export_key_raw(Crypt::PK::DH self, char * type) |
346 | 346 | CODE: |
347 | 347 | { |
348 | int rv, len; | |
349 | unsigned long buffer_len = 1024; | |
350 | unsigned char buffer[buffer_len]; | |
348 | int rv; | |
349 | unsigned long len, buffer_len = 1024; | |
350 | unsigned char buffer[1024]; | |
351 | 351 | void *key; |
352 | 352 | |
353 | 353 | RETVAL = newSVpvn(NULL, 0); /* undef */ |
28 | 28 | |
29 | 29 | void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned long length) |
30 | 30 | { |
31 | unsigned long s1, s2; | |
32 | ||
31 | 33 | LTC_ARGCHKVD(ctx != NULL); |
32 | 34 | LTC_ARGCHKVD(input != NULL); |
33 | unsigned long s1 = ctx->s[0]; | |
34 | unsigned long s2 = ctx->s[1]; | |
35 | s1 = ctx->s[0]; | |
36 | s2 = ctx->s[1]; | |
35 | 37 | |
36 | 38 | if (length % 8 != 0) { |
37 | 39 | do { |
80 | 82 | |
81 | 83 | void adler32_finish(adler32_state *ctx, void *hash, unsigned long size) |
82 | 84 | { |
85 | unsigned char* h; | |
86 | ||
83 | 87 | LTC_ARGCHKVD(ctx != NULL); |
84 | 88 | LTC_ARGCHKVD(hash != NULL); |
85 | 89 | |
86 | unsigned char* h = hash; | |
90 | h = hash; | |
87 | 91 | |
88 | 92 | switch (size) { |
89 | 93 | default: |
148 | 148 | |
149 | 149 | void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long length) |
150 | 150 | { |
151 | ulong32 crc; | |
151 | 152 | LTC_ARGCHKVD(ctx != NULL); |
152 | 153 | LTC_ARGCHKVD(input != NULL); |
153 | ulong32 crc = ctx->crc; | |
154 | crc = ctx->crc; | |
154 | 155 | |
155 | 156 | while (length--) |
156 | 157 | crc = crc32_m_tab[CRC32_INDEX(crc) ^ *input++] ^ CRC32_SHIFTED(crc); |
160 | 161 | |
161 | 162 | void crc32_finish(crc32_state *ctx, void *hash, unsigned long size) |
162 | 163 | { |
164 | unsigned char* h; | |
165 | unsigned long i; | |
166 | ulong32 crc; | |
167 | ||
163 | 168 | LTC_ARGCHKVD(ctx != NULL); |
164 | 169 | LTC_ARGCHKVD(hash != NULL); |
165 | 170 | |
166 | unsigned char* h = hash; | |
167 | unsigned long i; | |
168 | ||
169 | ulong32 crc = ctx->crc; | |
171 | h = hash; | |
172 | crc = ctx->crc; | |
170 | 173 | crc ^= _CRC32_NEGL; |
171 | 174 | for (i = 0; i < size; i++) { |
172 | 175 | h[size-i-1] = ((unsigned char*)&(crc))[i]; |