I created an internal function krb5_principal_compare() to compare two principals, and return TRUE if equal, FALSE otherwise.