I am wondering what is the security loss or consequences of accidentally misusing an HMAC API library in this context:
HMAC(K, m) = H((K' ⊕ opad) || H((K' ⊕ ipad) || m))
Misused HMAC (the inputs to HMAC were accidentally swapped):
HMAC(m, K) = H((m ⊕ opad) || H((m ⊕ ipad) || K))
In this context the 'm' is actually some encrypted random data (used in the standard "Encrypt then MAC" scheme) and could be considered public from an attacker's perspective. The key is 256 bits. The HMAC is HMAC-SHA-256.
Does this swapping of the inputs to HMAC mean that there is now a complete break or complete loss in security or the MAC? Is there now a length extension attack applicable? Or is it not so easily exploitable, seeing that the data is still hashed together by the outer hash?