comparison common-algo.c @ 1046:b8f4b7027191 coverity

merge
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Feb 2015 22:48:34 +0800
parents d3925ed45a85
children 1e486f368ec3 c45d65392c1a
comparison
equal deleted inserted replaced
1014:37c510c2ac7c 1046:b8f4b7027191
85 /* A few void* s are required to silence warnings 85 /* A few void* s are required to silence warnings
86 * about the symmetric_CBC vs symmetric_CTR cipher_state pointer */ 86 * about the symmetric_CBC vs symmetric_CTR cipher_state pointer */
87 #ifdef DROPBEAR_ENABLE_CBC_MODE 87 #ifdef DROPBEAR_ENABLE_CBC_MODE
88 const struct dropbear_cipher_mode dropbear_mode_cbc = 88 const struct dropbear_cipher_mode dropbear_mode_cbc =
89 {(void*)cbc_start, (void*)cbc_encrypt, (void*)cbc_decrypt}; 89 {(void*)cbc_start, (void*)cbc_encrypt, (void*)cbc_decrypt};
90 #endif // DROPBEAR_ENABLE_CBC_MODE 90 #endif /* DROPBEAR_ENABLE_CBC_MODE */
91 91
92 const struct dropbear_cipher_mode dropbear_mode_none = 92 const struct dropbear_cipher_mode dropbear_mode_none =
93 {void_start, void_cipher, void_cipher}; 93 {void_start, void_cipher, void_cipher};
94 94
95 #ifdef DROPBEAR_ENABLE_CTR_MODE 95 #ifdef DROPBEAR_ENABLE_CTR_MODE
100 int num_rounds, symmetric_CTR *ctr) { 100 int num_rounds, symmetric_CTR *ctr) {
101 return ctr_start(cipher, IV, key, keylen, num_rounds, CTR_COUNTER_BIG_ENDIAN, ctr); 101 return ctr_start(cipher, IV, key, keylen, num_rounds, CTR_COUNTER_BIG_ENDIAN, ctr);
102 } 102 }
103 const struct dropbear_cipher_mode dropbear_mode_ctr = 103 const struct dropbear_cipher_mode dropbear_mode_ctr =
104 {(void*)dropbear_big_endian_ctr_start, (void*)ctr_encrypt, (void*)ctr_decrypt}; 104 {(void*)dropbear_big_endian_ctr_start, (void*)ctr_encrypt, (void*)ctr_decrypt};
105 #endif // DROPBEAR_ENABLE_CTR_MODE 105 #endif /* DROPBEAR_ENABLE_CTR_MODE */
106 106
107 /* Mapping of ssh hashes to libtomcrypt hashes, including keysize etc. 107 /* Mapping of ssh hashes to libtomcrypt hashes, including keysize etc.
108 {&hash_desc, keysize, hashsize} */ 108 {&hash_desc, keysize, hashsize} */
109 109
110 #ifdef DROPBEAR_SHA1_HMAC 110 #ifdef DROPBEAR_SHA1_HMAC
181 #endif 181 #endif
182 {NULL, 0, NULL, 0, NULL} 182 {NULL, 0, NULL, 0, NULL}
183 }; 183 };
184 184
185 algo_type sshhashes[] = { 185 algo_type sshhashes[] = {
186 #ifdef DROPBEAR_SHA1_96_HMAC
187 {"hmac-sha1-96", 0, &dropbear_sha1_96, 1, NULL},
188 #endif
189 #ifdef DROPBEAR_SHA1_HMAC
190 {"hmac-sha1", 0, &dropbear_sha1, 1, NULL},
191 #endif
186 #ifdef DROPBEAR_SHA2_256_HMAC 192 #ifdef DROPBEAR_SHA2_256_HMAC
187 {"hmac-sha2-256", 0, &dropbear_sha2_256, 1, NULL}, 193 {"hmac-sha2-256", 0, &dropbear_sha2_256, 1, NULL},
188 #endif 194 #endif
189 #ifdef DROPBEAR_SHA2_512_HMAC 195 #ifdef DROPBEAR_SHA2_512_HMAC
190 {"hmac-sha2-512", 0, &dropbear_sha2_512, 1, NULL}, 196 {"hmac-sha2-512", 0, &dropbear_sha2_512, 1, NULL},
191 #endif
192 #ifdef DROPBEAR_SHA1_96_HMAC
193 {"hmac-sha1-96", 0, &dropbear_sha1_96, 1, NULL},
194 #endif
195 #ifdef DROPBEAR_SHA1_HMAC
196 {"hmac-sha1", 0, &dropbear_sha1, 1, NULL},
197 #endif 197 #endif
198 #ifdef DROPBEAR_MD5_HMAC 198 #ifdef DROPBEAR_MD5_HMAC
199 {"hmac-md5", 0, (void*)&dropbear_md5, 1, NULL}, 199 {"hmac-md5", 0, (void*)&dropbear_md5, 1, NULL},
200 #endif 200 #endif
201 #ifdef DROPBEAR_NONE_INTEGRITY 201 #ifdef DROPBEAR_NONE_INTEGRITY