In volume 4, section 7 of the Landau and Lifshitz collection (second edition) the authors discuss spherical wavefunctions of photons. I'm having trouble understanding how the equality in (7.7) is obtained.
It is said that the wavefunction (in the momentum representation) of a photon having an angular momentum $j$ and component along some given axis $m$ is $$\mathbf{A}_{\omega j m}(\mathbf{k})=\frac{4\pi^2}{\omega^{3/2}} \delta(|\mathbf{k}|-\omega)\mathbf{Y}_{jm}(\mathbf{n}),$$ where $\mathbf{n}$ is a unit vector representing direction and $\mathbf{Y}_{jm}$ are the "spherical harmonic vectors" which satisfy the normalization relation $$\int \mathbf{Y}_{jm}\cdot \mathbf{Y}_{j'm'}^* d o = \delta_{jj'}\delta_{mm'},$$ where $o$ represents solid angle and integration takes place over all directions.
Equation (7.7) states that the photon wavefunctions satisfy the normalization $$\frac{1}{(2\pi)^4} \int \omega\omega' \mathbf{A}_{\omega'j'm'}^*(\mathbf{k})\cdot\mathbf{A}_{\omega jm}(\mathbf{k})d^3k=\omega \delta(\omega'-\omega)\delta_{jj'}\delta_{mm'}.$$ I do not follow how this equality is obtained. When I attempt to plug in the available expressions in this integral I obtain $$ \int \frac{1}{\sqrt{\omega\omega'}}\delta(|\mathbf{k}|-\omega')\delta(|\mathbf{k}|-\omega)\mathbf{Y}_{jm}\cdot \mathbf{Y}_{j'm'}^* |\mathbf{k}|^2\hphantom{;}d|\mathbf{k}|\hphantom{;}d o = \int \frac{\delta(|\mathbf{k}|-\omega')\delta(|\mathbf{k}|-\omega)}{\sqrt{\omega\omega'}}\delta_{jj'}\delta_{mm'} |\mathbf{k}|^2\hphantom{;}d|\mathbf{k}|.$$ I do not understand how to deal with the two delta functions appearing under the integral. I can see that if $\omega\neq\omega'$ then this could be interpreted to be $0$. However when $\omega=\omega'$, a square of the delta function appears, the integral of which does not exist.
I hope someone can help out, and thank you in advance.