aboutsummaryrefslogtreecommitdiff
path: root/gost_keyexpimp.c
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2019-09-04 22:45:37 +0300
committerDmitry Belyavskiy <beldmit@gmail.com>2019-09-04 22:45:37 +0300
commita418dfa28b4c3432a6da7d01adc1038789ce209c (patch)
tree716f0316caf2b4f04e1bd601ab4a1990629271b8 /gost_keyexpimp.c
parent31c3aa7e30ab0820409ed702c668c19508af9604 (diff)
downloadgost-engine-a418dfa28b4c3432a6da7d01adc1038789ce209c.zip
gost-engine-a418dfa28b4c3432a6da7d01adc1038789ce209c.tar.gz
gost-engine-a418dfa28b4c3432a6da7d01adc1038789ce209c.tar.bz2
Get rid of EVP_MD_CTRL_MAC_LEN
Diffstat (limited to 'gost_keyexpimp.c')
-rw-r--r--gost_keyexpimp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gost_keyexpimp.c b/gost_keyexpimp.c
index 6df1b2a..e8ee1eb 100644
--- a/gost_keyexpimp.c
+++ b/gost_keyexpimp.c
@@ -46,11 +46,11 @@ int gost_kexp15(const unsigned char *shared_key, const int shared_len,
if (EVP_DigestInit_ex(mac, EVP_get_digestbynid(mac_nid), NULL) <= 0
|| omac_imit_ctrl(mac, EVP_MD_CTRL_SET_KEY, 32, mac_key) <= 0
- || omac_imit_ctrl(mac, EVP_MD_CTRL_MAC_LEN, mac_len, NULL) <= 0
+ || omac_imit_ctrl(mac, EVP_MD_CTRL_XOF_LEN, mac_len, NULL) <= 0
|| EVP_DigestUpdate(mac, iv, ivlen) <= 0
|| EVP_DigestUpdate(mac, shared_key, shared_len) <= 0
/* As we set MAC length directly, we should not allow overwriting it */
- || EVP_DigestFinal_ex(mac, mac_buf, NULL) <= 0) {
+ || EVP_DigestFinalXOF(mac, mac_buf, mac_len) <= 0) {
GOSTerr(GOST_F_GOST_KEXP15, ERR_R_INTERNAL_ERROR);
goto err;
}
@@ -139,11 +139,11 @@ int gost_kimp15(const unsigned char *expkey, const size_t expkeylen,
if (EVP_DigestInit_ex(mac, EVP_get_digestbynid(mac_nid), NULL) <= 0
|| omac_imit_ctrl(mac, EVP_MD_CTRL_SET_KEY, 32, mac_key) <= 0
- || omac_imit_ctrl(mac, EVP_MD_CTRL_MAC_LEN, mac_len, NULL) <= 0
+ || omac_imit_ctrl(mac, EVP_MD_CTRL_XOF_LEN, mac_len, NULL) <= 0
|| EVP_DigestUpdate(mac, iv, ivlen) <= 0
|| EVP_DigestUpdate(mac, out, shared_len) <= 0
/* As we set MAC length directly, we should not allow overwriting it */
- || EVP_DigestFinal_ex(mac, mac_buf, NULL) <= 0) {
+ || EVP_DigestFinalXOF(mac, mac_buf, mac_len) <= 0) {
GOSTerr(GOST_F_GOST_KIMP15, ERR_R_INTERNAL_ERROR);
goto err;
}