sync code with last fixes and improvements from OpenBSD

This commit is contained in:
purplerain 2023-07-30 17:58:45 +00:00
parent f960599e67
commit 691f97cc10
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
215 changed files with 1520 additions and 11518 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: crypto.c,v 1.44 2023/06/06 13:27:49 claudio Exp $ */
/* $OpenBSD: crypto.c,v 1.45 2023/07/28 07:31:38 claudio Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@ -327,7 +327,7 @@ hash_free(struct iked_hash *hash)
void
hash_init(struct iked_hash *hash)
{
HMAC_Init_ex(hash->hash_ctx, hash->hash_key->buf,
HMAC_Init_ex(hash->hash_ctx, ibuf_data(hash->hash_key),
ibuf_length(hash->hash_key), hash->hash_priv, NULL);
}
@ -572,7 +572,7 @@ cipher_init(struct iked_cipher *encr, int enc)
encr->encr_saltlength), encr->encr_saltlength);
if (nonce == NULL)
return (-1);
if (ibuf_add(nonce, ibuf_data(encr->encr_iv) , ibuf_size(encr->encr_iv)) != 0)
if (ibuf_add_buf(nonce, encr->encr_iv) != 0)
goto done;
if (EVP_CipherInit_ex(encr->encr_ctx, NULL, NULL,
ibuf_data(encr->encr_key), ibuf_data(nonce), enc) != 1)