Skip to content

Commit

Permalink
Upgrade BouncyCastle to 1.67
Browse files Browse the repository at this point in the history
DEV-2005
  • Loading branch information
Nikita Kovaliov authored and nikitakovaliov92 committed Feb 15, 2022
1 parent ce8bbac commit 5654206
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions itext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.66</version>
<version>1.67</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.66</version>
<version>1.67</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;

import org.bouncycastle.asn1.ASN1Encoding;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1OutputStream;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Set;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.DEROutputStream;
import org.bouncycastle.asn1.DERSet;
import org.bouncycastle.asn1.cms.ContentInfo;
import org.bouncycastle.asn1.cms.EncryptedContentInfo;
Expand Down Expand Up @@ -194,7 +195,7 @@ public byte[] getEncodedRecipient(int index) throws IOException, GeneralSecurity

ByteArrayOutputStream baos = new ByteArrayOutputStream();

DEROutputStream k = new DEROutputStream(baos);
ASN1OutputStream k = ASN1OutputStream.create(baos, ASN1Encoding.DER);

k.writeObject(obj);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ else if (externalRSAdata != null && RSAdata != null) {
// Add the digestAlgorithm
v = new ASN1EncodableVector();
v.add(new ASN1ObjectIdentifier(digestAlgorithmOid));
v.add(new DERNull());
v.add(DERNull.INSTANCE);
signerinfo.add(new DERSequence(v));

// add the authenticated attribute if present
Expand All @@ -816,7 +816,7 @@ else if (externalRSAdata != null && RSAdata != null) {
// Add the digestEncryptionAlgorithm
v = new ASN1EncodableVector();
v.add(new ASN1ObjectIdentifier(digestEncryptionAlgorithmOid));
v.add(new DERNull());
v.add(DERNull.INSTANCE);
signerinfo.add(new DERSequence(v));

// Add the digest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ This file is part of the iText (R) project.
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import com.itextpdf.text.pdf.codec.Base64;
import org.bouncycastle.asn1.DERIA5String;
import org.bouncycastle.asn1.DERObjectIdentifier;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.esf.*;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
Expand Down Expand Up @@ -118,7 +117,7 @@ SignaturePolicyIdentifier toSignaturePolicyIdentifier() {
}
SigPolicyQualifiers qualifiers = new SigPolicyQualifiers(new SigPolicyQualifierInfo[] {spqi});

signaturePolicyIdentifier = new SignaturePolicyIdentifier(new SignaturePolicyId(DERObjectIdentifier.getInstance(new DERObjectIdentifier(this.policyIdentifier.replace("urn:oid:", ""))),
signaturePolicyIdentifier = new SignaturePolicyIdentifier(new SignaturePolicyId(ASN1ObjectIdentifier.getInstance(new ASN1ObjectIdentifier(this.policyIdentifier.replace("urn:oid:", ""))),
new OtherHashAlgAndValue(new AlgorithmIdentifier(new ASN1ObjectIdentifier(algId)), new DEROctetString(this.policyHash)), qualifiers));

return signaturePolicyIdentifier;
Expand Down
2 changes: 1 addition & 1 deletion pdfa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.66</version>
<version>1.67</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down

0 comments on commit 5654206

Please sign in to comment.