diffie hellman digital signatures vs MACs I have the following homework question that im not sure about.

Alice and bob are going to use the diffie-hellman key agreement protocol to agree on a key for use in AES. Explain briefly why they would need to use digital signatures and why they cannot use Message Authentication Codes (MACs) instead.

I find the question a bit hard to understand, im aware that MACs require a shared secret key to compute the MAC so this would have to be done first but am not sure why digital signatures need to be used ?
The homework task is making an implicit assumption:

They don't have a common shared secret.

That's implicated by the fact that they do a DH key exchange and nothing else to exchange the key. A common shared secret would offer muc more possibilities, e.g. combine a DH key exchange with the shared secret as input to a KDF.

You realized yourself that a shared secret is required for MAC. So what protects the DH  key exchange from man-in-the-middle attacks? Because (not-authenticated) DH key exchange is vulnerable to that.