Skip to content

Commit 8939c73

Browse files
author
gefeili
committed
Set the KekLength maximum to 65535 for CMSORIforKEMOtherInfo.
1 parent 8bfc24f commit 8939c73

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

util/src/main/java/org/bouncycastle/asn1/cms/CMSORIforKEMOtherInfo.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* <pre>
1414
* CMSORIforKEMOtherInfo ::= SEQUENCE {
1515
* wrap KeyEncryptionAlgorithmIdentifier,
16-
* kekLength INTEGER (1..MAX),
16+
* kekLength INTEGER (1..65535),
1717
* ukm [0] EXPLICIT UserKeyingMaterial OPTIONAL
1818
* }
1919
*
@@ -34,6 +34,10 @@ public CMSORIforKEMOtherInfo(AlgorithmIdentifier wrap, int kekLength)
3434

3535
public CMSORIforKEMOtherInfo(AlgorithmIdentifier wrap, int kekLength, byte[] ukm)
3636
{
37+
if (kekLength > 65535)
38+
{
39+
throw new IllegalArgumentException("kekLength must be <= 65535");
40+
}
3741
this.wrap = wrap;
3842
this.kekLength = kekLength;
3943
this.ukm = ukm;

0 commit comments

Comments
 (0)