comparison keyimport.c @ 1038:d3925ed45a85

Fix for old compilers, variable declarations at beginning of functions and /**/ comments
author Thorsten Horstmann <thorsten.horstmann@web.de>
date Tue, 24 Feb 2015 20:51:18 +0800
parents 97d1e54941fd
children 31727a8abd4b
comparison
equal deleted inserted replaced
1037:7c899f24a85b 1038:d3925ed45a85
1044 const long curve_size = (*eck)->dp->size; 1044 const long curve_size = (*eck)->dp->size;
1045 int curve_oid_len = 0; 1045 int curve_oid_len = 0;
1046 const void* curve_oid = NULL; 1046 const void* curve_oid = NULL;
1047 unsigned long pubkey_size = 2*curve_size+1; 1047 unsigned long pubkey_size = 2*curve_size+1;
1048 unsigned int k_size; 1048 unsigned int k_size;
1049 int err = 0;
1049 1050
1050 /* version. less than 10 bytes */ 1051 /* version. less than 10 bytes */
1051 buf_incrwritepos(seq_buf, 1052 buf_incrwritepos(seq_buf,
1052 ber_write_id_len(buf_getwriteptr(seq_buf, 10), 2, 1, 0)); 1053 ber_write_id_len(buf_getwriteptr(seq_buf, 10), 2, 1, 0));
1053 buf_putbyte(seq_buf, 1); 1054 buf_putbyte(seq_buf, 1);
1089 buf_incrwritepos(seq_buf, 1090 buf_incrwritepos(seq_buf,
1090 ber_write_id_len(buf_getwriteptr(seq_buf, 10), 1, 2+1+pubkey_size, 0xa0)); 1091 ber_write_id_len(buf_getwriteptr(seq_buf, 10), 1, 2+1+pubkey_size, 0xa0));
1091 buf_incrwritepos(seq_buf, 1092 buf_incrwritepos(seq_buf,
1092 ber_write_id_len(buf_getwriteptr(seq_buf, 10), 3, 1+pubkey_size, 0)); 1093 ber_write_id_len(buf_getwriteptr(seq_buf, 10), 3, 1+pubkey_size, 0));
1093 buf_putbyte(seq_buf, 0); 1094 buf_putbyte(seq_buf, 0);
1094 int err = ecc_ansi_x963_export(*eck, buf_getwriteptr(seq_buf, pubkey_size), &pubkey_size); 1095 err = ecc_ansi_x963_export(*eck, buf_getwriteptr(seq_buf, pubkey_size), &pubkey_size);
1095 if (err != CRYPT_OK) { 1096 if (err != CRYPT_OK) {
1096 dropbear_exit("ECC error"); 1097 dropbear_exit("ECC error");
1097 } 1098 }
1098 buf_incrwritepos(seq_buf, pubkey_size); 1099 buf_incrwritepos(seq_buf, pubkey_size);
1099 1100