Skip to content

Commit

Permalink
Set the SpcSpOpusInfo attribute only if programName or programURL are…
Browse files Browse the repository at this point in the history
… specified
  • Loading branch information
ebourg committed Jul 16, 2024
1 parent 0e70b62 commit fb951f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jsign-core/src/main/java/net/jsign/AuthenticodeSigner.java
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,10 @@ private AttributeTable createAuthenticatedAttributes() {
SpcStatementType spcStatementType = new SpcStatementType(AuthenticodeObjectIdentifiers.SPC_INDIVIDUAL_SP_KEY_PURPOSE_OBJID);
attributes.add(new Attribute(AuthenticodeObjectIdentifiers.SPC_STATEMENT_TYPE_OBJID, new DERSet(spcStatementType)));

SpcSpOpusInfo spcSpOpusInfo = new SpcSpOpusInfo(programName, programURL);
attributes.add(new Attribute(AuthenticodeObjectIdentifiers.SPC_SP_OPUS_INFO_OBJID, new DERSet(spcSpOpusInfo)));
if (programName != null || programURL != null) {
SpcSpOpusInfo spcSpOpusInfo = new SpcSpOpusInfo(programName, programURL);
attributes.add(new Attribute(AuthenticodeObjectIdentifiers.SPC_SP_OPUS_INFO_OBJID, new DERSet(spcSpOpusInfo)));
}

return new AttributeTable(new DERSet(attributes.toArray(new ASN1Encodable[0])));
}
Expand Down

0 comments on commit fb951f4

Please sign in to comment.