X509 certificates: Two Algorithm Identifiers?
I'm assuming you're talking about these two fields:


signature
signatureAlgorithm


following the names defined in RFC 5280 section 4.1. And section 4.1.1.2 then goes on to state (for signatureAlgorithm):


  This field MUST contain the same algorithm identifier as the signature field in the sequence tbsCertificate (Section 4.1.2.3).


So, yes, they have to be the same.