Skip to content

Commit

Permalink
Merge branch 'certValidate' of [email protected]:Stirling-Tools/Stirling…
Browse files Browse the repository at this point in the history
…-PDF.git into certValidate
  • Loading branch information
a committed Dec 5, 2024
2 parents ff45651 + 6152d3f commit 4b8b088
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package stirling.software.SPDF.service;

import io.github.pixee.security.BoundedLineReader;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -44,14 +45,14 @@ private void loadMozillaCertificates() throws Exception {
boolean inCert = false;
int certCount = 0;

while ((line = reader.readLine()) != null) {
while ((line = BoundedLineReader.readLine(reader, 5_000_000)) != null) {
if (line.startsWith("CKA_VALUE MULTILINE_OCTAL")) {
inCert = true;
certData = new StringBuilder();
continue;
}
if (inCert) {
if (line.equals("END")) {
if ("END".equals(line)) {
inCert = false;
byte[] certBytes = parseOctalData(certData.toString());
if (certBytes != null) {
Expand Down

0 comments on commit 4b8b088

Please sign in to comment.