Skip to content

Commit

Permalink
[RELEASE] iText 5 - 5.5.13.4
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jun 13, 2024
2 parents 0231a60 + e8a0a1f commit aabad9a
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 66 deletions.
8 changes: 4 additions & 4 deletions itext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>itextpdf</artifactId>
<version>5.5.13.3</version>
<version>5.5.13.4</version>

<name>iText Core</name>
<description>A Free Java-PDF library</description>
Expand Down Expand Up @@ -75,13 +75,13 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.70</version>
<version>1.78.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcpkix-jdk15to18</artifactId>
<version>1.78.1</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions itext/src/main/java/com/itextpdf/text/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ public final class Version {
* This String contains the version number of this iText release.
* For debugging purposes, we request you NOT to change this constant.
*/
private final String release = "5.5.13.3";
private final String release = "5.5.13.4";
/**
* This String contains the iText version as shown in the producer line.
* iText is a product developed by iText Group NV.
* iText Group requests that you retain the iText producer line
* in every PDF that is created or manipulated using iText.
*/
private String iTextVersion = iText + " " + release + " \u00a92000-2022 iText Group NV";
private String iTextVersion = iText + " " + release + " \u00a92000-2024 iText Group NV";
/**
* The license key.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,14 @@ public DefaultSplitCharacter(char[] characters) {
* @return <CODE>true</CODE> if the character can be used to split a string, <CODE>false</CODE> otherwise
*/
public boolean isSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck) {
char[] ccTmp = checkDatePattern(String.valueOf(cc));
char c = getCurrentCharacter(current, ccTmp, ck);
char c = getCurrentCharacter(current, cc, ck);
if (c == '-') {
int beginDateidx = Math.max(current - 8, 0);
int dateLength = Math.min(16, cc.length - beginDateidx);
if (containsDate(String.valueOf(cc, beginDateidx, dateLength))) {
return false;
}
}

if (characters != null) {
for (int i = 0; i < characters.length; i++) {
Expand Down Expand Up @@ -155,14 +161,8 @@ protected char getCurrentCharacter(int current, char[] cc, PdfChunk[] ck) {
return (char) ck[Math.min(current, ck.length - 1)].getUnicodeEquivalent(cc[current]);
}

private char[] checkDatePattern(String data) {
if (data.contains("-")) {
Matcher m = DATE_PATTERN.matcher(data);
if (m.find()) {
String tmpData = m.group(1).replace('-', '\u2011');
data = data.replaceAll(m.group(1), tmpData);
}
}
return data.toCharArray();
private static boolean containsDate(String data) {
Matcher m = DATE_PATTERN.matcher(data);
return m.find();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static String getCRLURL(X509Certificate certificate) throws CertificatePa
if (name.getTagNo() != GeneralName.uniformResourceIdentifier) {
continue;
}
DERIA5String derStr = DERIA5String.getInstance((ASN1TaggedObject)name.toASN1Primitive(), false);
DERIA5String derStr = (DERIA5String) DERIA5String.getInstance((ASN1TaggedObject)name.toASN1Primitive(), false);
return derStr.getString();
}
}
Expand Down
12 changes: 6 additions & 6 deletions itext/src/main/java/com/itextpdf/text/pdf/security/PdfPKCS7.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public PdfPKCS7(byte[] contentsKey, PdfName filterSubtype, String provider) {
ASN1ObjectIdentifier objId = (ASN1ObjectIdentifier)signedData.getObjectAt(0);
if (!objId.getId().equals(SecurityIDs.ID_PKCS7_SIGNED_DATA))
throw new IllegalArgumentException(MessageLocalization.getComposedMessage("not.a.valid.pkcs.7.object.not.signed.data"));
ASN1Sequence content = (ASN1Sequence)((ASN1TaggedObject)signedData.getObjectAt(1)).getObject();
ASN1Sequence content = (ASN1Sequence)((ASN1TaggedObject)signedData.getObjectAt(1)).getBaseObject();
// the positions that we care are:
// 0 - version
// 1 - digestAlgorithms
Expand All @@ -243,7 +243,7 @@ public PdfPKCS7(byte[] contentsKey, PdfName filterSubtype, String provider) {
// the possible ID_PKCS7_DATA
ASN1Sequence rsaData = (ASN1Sequence)content.getObjectAt(2);
if (rsaData.size() > 1) {
ASN1OctetString rsaDataContent = (ASN1OctetString)((ASN1TaggedObject)rsaData.getObjectAt(1)).getObject();
ASN1OctetString rsaDataContent = (ASN1OctetString)((ASN1TaggedObject)rsaData.getObjectAt(1)).getBaseObject();
RSAdata = rsaDataContent.getOctets();
}

Expand Down Expand Up @@ -343,11 +343,11 @@ else if (idSeq2.equals(SecurityIDs.ID_ADBE_REVOCATION)) {
for (int j = 0; j < seqout.size(); ++j) {
ASN1TaggedObject tg = (ASN1TaggedObject)seqout.getObjectAt(j);
if (tg.getTagNo() == 0) {
ASN1Sequence seqin = (ASN1Sequence)tg.getObject();
ASN1Sequence seqin = (ASN1Sequence)tg.getBaseObject();
findCRL(seqin);
}
if (tg.getTagNo() == 1) {
ASN1Sequence seqin = (ASN1Sequence)tg.getObject();
ASN1Sequence seqin = (ASN1Sequence)tg.getBaseObject();
findOcsp(seqin);
}
}
Expand Down Expand Up @@ -1283,8 +1283,8 @@ private void findOcsp(ASN1Sequence seq) throws IOException {
}
if (seq.getObjectAt(k) instanceof ASN1TaggedObject) {
ASN1TaggedObject tag = (ASN1TaggedObject)seq.getObjectAt(k);
if (tag.getObject() instanceof ASN1Sequence) {
seq = (ASN1Sequence)tag.getObject();
if (tag.getBaseObject() instanceof ASN1Sequence) {
seq = (ASN1Sequence)tag.getBaseObject();
ret = false;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class DefaultSplitCharacterProfilingTest {

private static final String READ_FILE_FAIL_MESSAGE = "Failed to read test file {0}. The test could not be completed.";

private static final int TIME_LIMIT = 20000;
private static final int TIME_LIMIT = 5000;

@Test(timeout = 30000)
public void checkDatePatternProfilingTest() {
Expand Down
4 changes: 2 additions & 2 deletions pdfa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>itext-pdfa</artifactId>
<version>5.5.13.3</version>
<version>5.5.13.4</version>

<name>iText PDF/A</name>
<description>iText ISO-19005 Module</description>
Expand Down Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.70</version>
<version>1.78.1</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>

<artifactId>root</artifactId>
<version>5.5.13.3</version>
<version>5.5.13.4</version>
<packaging>pom</packaging>

<name>iText</name>
Expand Down
2 changes: 1 addition & 1 deletion xmlworker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>5.5.13.3</version>
<version>5.5.13.4</version>

<name>iText XML Worker</name>
<description>Parses XML to PDF, with CSS support, using iText</description>
Expand Down
51 changes: 14 additions & 37 deletions xtra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>itext-xtra</artifactId>
<version>5.5.13.3</version>
<version>5.5.13.4</version>

<name>iText Xtra</name>
<description>iText Xtra, part of iText a Free Java-PDF library</description>
Expand Down Expand Up @@ -63,6 +63,9 @@
</ciManagement>

<properties>
<!-- itext-xtra depends on java 1.8 because
earliest published stable version of common-imaging requires java8 -->
<xtra.java.version>1.8</xtra.java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<argLine>-Xmx128m</argLine>
<sonar.language>java</sonar.language>
Expand All @@ -80,7 +83,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-imaging</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0-alpha1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -111,6 +114,15 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${xtra.java.version}</source>
<target>${xtra.java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
Expand Down Expand Up @@ -227,41 +239,6 @@
</dependencies>
</profile>
<!-- END: Specific to mapping unit tests and covered code -->

<profile>
<id>compileWithLegacyJDK</id>
<!--
NOTE
Make sure to set the environment variable JAVA7_HOME
to your JDK 1.7 HOME when using this profile.
-->
<properties>
<java.version>1.7</java.version>
<java.home>${env.JAVA7_HOME}</java.home>
<java.libs>${java.home}/jre/lib</java.libs>
<java.bootclasspath>${java.libs}/rt.jar${path.separator}${java.libs}/jce.jar</java.bootclasspath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArguments>
<bootclasspath>${java.bootclasspath}</bootclasspath>
</compilerArguments>
<compilerVersion>${java.version}</compilerVersion>
<fork>true</fork>
<executable>${java.home}/bin/javac</executable>
</configuration>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>

0 comments on commit aabad9a

Please sign in to comment.