Skip to content

Commit d6ba16b

Browse files
authored
Merge pull request #878 from mt-johan/feature/no-senderkid-req-for-pbmac1-part2
Make PKIMessage.PKIHeader.senderKID optional for PBE/PBMAC1 since it …
2 parents 9923c72 + cca5049 commit d6ba16b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

modules/ejbca-common-web/src/org/ejbca/core/protocol/cmp/CmpErrorResponseMessage.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ public String getFailText() {
123123
@Override
124124
public boolean create() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException {
125125
final PKIHeaderBuilder myPKIHeaderBuilder = CmpMessageHelper.createPKIHeaderBuilder(getSender(), getRecipient(), getSenderNonce(), getRecipientNonce(), getTransactionId());
126-
final boolean pbeProtected = (getPbeDigestAlg() != null) && (getPbeMacAlg() != null) && (getPbeKeyId() != null) && (getPbeKey() != null) ;
127-
final boolean pbmac1Protected = (getPbmac1PrfAlg() != null) && (getPbmac1MacAlg() != null) && (getPbmac1KeyId() != null)
128-
&& (getPbmac1Key() != null);
126+
final boolean pbeProtected = (getPbeDigestAlg() != null) && (getPbeMacAlg() != null) && (getPbeKey() != null) ;
127+
final boolean pbmac1Protected = (getPbmac1PrfAlg() != null) && (getPbmac1MacAlg() != null) && (getPbmac1Key() != null);
129128
if(pbeProtected) {
130129
myPKIHeaderBuilder.setProtectionAlg(new AlgorithmIdentifier(CMPObjectIdentifiers.passwordBasedMac));
131130
}

modules/ejbca-ejb/src/org/ejbca/core/protocol/cmp/CmpConfirmResponseMessage.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ public boolean create() throws InvalidKeyException, NoSuchAlgorithmException, No
122122
final PKIBody myPKIBody = new PKIBody(19, DERNull.INSTANCE);
123123
PKIMessage myPKIMessage = null;
124124

125-
final boolean pbeProtected = (getPbeDigestAlg() != null) && (getPbeMacAlg() != null) && (getPbeKeyId() != null) && (getPbeKey() != null) ;
126-
final boolean pbmac1Protected = (getPbmac1PrfAlg() != null) && (getPbmac1MacAlg() != null) && (getPbmac1KeyId() != null)
127-
&& (getPbmac1Key() != null);
125+
final boolean pbeProtected = (getPbeDigestAlg() != null) && (getPbeMacAlg() != null) && (getPbeKey() != null);
126+
final boolean pbmac1Protected = (getPbmac1PrfAlg() != null) && (getPbmac1MacAlg() != null) && (getPbmac1Key() != null);
128127
if (pbeProtected) {
129128
myPKIHeader.setProtectionAlg(new AlgorithmIdentifier(new ASN1ObjectIdentifier(getPbeDigestAlg())));
130129
myPKIMessage = new PKIMessage(myPKIHeader.build(), myPKIBody);

0 commit comments

Comments
 (0)