Skip to content

Commit

Permalink
Apply suggestions from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Nov 18, 2020
1 parent 8d7595b commit 4292496
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/pkcs7.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ function _recipientFromAsn1(obj) {
serialNumber: forge.util.createBuffer(capture.serial).toHex(),
encryptedContent: {
algorithm: asn1.derToOid(capture.encAlgorithm),
parameter: capture.encParameter ? capture.encParameter.value : null,
parameter: capture.encParameter ? capture.encParameter.value : undefined,
content: capture.encKey
}
};
Expand Down Expand Up @@ -1124,10 +1124,11 @@ function _encryptedContentToAsn1(ec) {
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
asn1.oidToDer(ec.algorithm).getBytes()),
// Parameters (IV)
( ec.parameter ?
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
ec.parameter.getBytes()) : undefined
)
!ec.parameter ?
undefined :
asn1.create(
asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
ec.parameter.getBytes())
]),
// [0] EncryptedContent
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
Expand Down

0 comments on commit 4292496

Please sign in to comment.