+#ifdef _WIN32
+#include <winsock.h>
+#else
#include <arpa/inet.h>
+#endif
#include <string.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include "gost_lcl.h"
#include "e_gost_err.h"
-/* FIXME no-deprecated*/
int omac_imit_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr);
/*
* Function expects that out is a preallocated buffer of length
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;
}
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;
}