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