Lines Matching refs:verify
182 * verify key usage (must allow encryption)
206 int tls_verify_hash_init(struct tls_verify_hash *verify)
208 tls_verify_hash_free(verify);
209 verify->md5_client = crypto_hash_init(CRYPTO_HASH_ALG_MD5, NULL, 0);
210 verify->md5_server = crypto_hash_init(CRYPTO_HASH_ALG_MD5, NULL, 0);
211 verify->md5_cert = crypto_hash_init(CRYPTO_HASH_ALG_MD5, NULL, 0);
212 verify->sha1_client = crypto_hash_init(CRYPTO_HASH_ALG_SHA1, NULL, 0);
213 verify->sha1_server = crypto_hash_init(CRYPTO_HASH_ALG_SHA1, NULL, 0);
214 verify->sha1_cert = crypto_hash_init(CRYPTO_HASH_ALG_SHA1, NULL, 0);
215 if (verify->md5_client == NULL || verify->md5_server == NULL ||
216 verify->md5_cert == NULL || verify->sha1_client == NULL ||
217 verify->sha1_server == NULL || verify->sha1_cert == NULL) {
218 tls_verify_hash_free(verify);
222 verify->sha256_client = crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL,
224 verify->sha256_server = crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL,
226 verify->sha256_cert = crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL,
228 if (verify->sha256_client == NULL || verify->sha256_server == NULL ||
229 verify->sha256_cert == NULL) {
230 tls_verify_hash_free(verify);
238 void tls_verify_hash_add(struct tls_verify_hash *verify, const u8 *buf,
241 if (verify->md5_client && verify->sha1_client) {
242 crypto_hash_update(verify->md5_client, buf, len);
243 crypto_hash_update(verify->sha1_client, buf, len);
245 if (verify->md5_server && verify->sha1_server) {
246 crypto_hash_update(verify->md5_server, buf, len);
247 crypto_hash_update(verify->sha1_server, buf, len);
249 if (verify->md5_cert && verify->sha1_cert) {
250 crypto_hash_update(verify->md5_cert, buf, len);
251 crypto_hash_update(verify->sha1_cert, buf, len);
254 if (verify->sha256_client)
255 crypto_hash_update(verify->sha256_client, buf, len);
256 if (verify->sha256_server)
257 crypto_hash_update(verify->sha256_server, buf, len);
258 if (verify->sha256_cert)
259 crypto_hash_update(verify->sha256_cert, buf, len);
264 void tls_verify_hash_free(struct tls_verify_hash *verify)
266 crypto_hash_finish(verify->md5_client, NULL, NULL);
267 crypto_hash_finish(verify->md5_server, NULL, NULL);
268 crypto_hash_finish(verify->md5_cert, NULL, NULL);
269 crypto_hash_finish(verify->sha1_client, NULL, NULL);
270 crypto_hash_finish(verify->sha1_server, NULL, NULL);
271 crypto_hash_finish(verify->sha1_cert, NULL, NULL);
272 verify->md5_client = NULL;
273 verify->md5_server = NULL;
274 verify->md5_cert = NULL;
275 verify->sha1_client = NULL;
276 verify->sha1_server = NULL;
277 verify->sha1_cert = NULL;
279 crypto_hash_finish(verify->sha256_client, NULL, NULL);
280 crypto_hash_finish(verify->sha256_server, NULL, NULL);
281 crypto_hash_finish(verify->sha256_cert, NULL, NULL);
282 verify->sha256_client = NULL;
283 verify->sha256_server = NULL;
284 verify->sha256_cert = NULL;
442 wpa_printf(MSG_DEBUG, "TLSv1: No public key to verify signature");