fix detection of replica key used for master key wrapping