I've implemented the algorithm as a cipher with the EVP_CIPH_WRAP_MODE flag.
It seems to me that the only way to avoid clearing the EVP_CIPHER_CTX_FLAG_WRAP_ALLOW flag in the EVP_CipherInit function is providing the ctrl function in the corresponding EVP_CIPHER object because the EVP_CipherInit function resets the passed EVP_CIPHER_CTX object.
The EVP_CipherInit_ex does not reset the EVP_CIPHER_CTX object and theEVP_CIPHER_CTX_FLAG_WRAP_ALLOW stays untouched, so the behavior seems a bit controversial (and undocumented, at least for the 1.1.1 branch).
Is this difference a desired one or an accidental one? Should it be documented or fixed?