* Calculate protection for given PKImessage utilizing the given credentials
* and the algorithm parameters set inside the message header's protectionAlg.
*
- * Either secret or pkey must be set, the other must be NULL. Attempts doing
- * PBMAC in case 'secret' is set and signature if 'pkey' is set - but will only
+ * secret or pkey must be set. Attempts doing PBMAC in case 'secret' is set
+ * and else signature if 'pkey' is set - but will only
* do the protection already marked in msg->header->protectionAlg.
*
* returns ptr to ASN1_BIT_STRING containing protection on success, else NULL
}
X509_ALGOR_get0(&algorOID, &pptype, &ppval, msg->header->protectionAlg);
- if (secret != NULL && pkey == NULL) {
+ if (secret != NULL) {
if (ppval == NULL) {
CMPerr(0, CMP_R_ERROR_CALCULATING_PROTECTION);
goto end;
secret->data, secret->length,
&protection, &sig_len))
goto end;
- } else if (secret == NULL && pkey != NULL) {
+ } else if (pkey != NULL) {
/* TODO combine this with large parts of CRMF_poposigningkey_init() */
/* EVP_DigestSignInit() checks that pkey type is correct for the alg */