Skip to content

Commit

Permalink
fix: up bouncy castle version
Browse files Browse the repository at this point in the history
Closes: XRDDEV-2597
  • Loading branch information
ovidijusnortal committed Feb 21, 2024
1 parent d6a7da3 commit 19cbcf2
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/addons/messagelog/messagelog-addon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
testImplementation project(':common:common-test')
testImplementation project(':addons:messagelog:messagelog-archiver')
testImplementation "org.hsqldb:hsqldb:$hsqldbVersion"
testImplementation "org.bouncycastle:bcpg-jdk15on:${bouncyCastleVersion}"
testImplementation "org.bouncycastle:bcpg-jdk18on:${bouncyCastleVersion}"
}

jar {
Expand Down
2 changes: 1 addition & 1 deletion src/addons/messagelog/messagelog-db/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
implementation(project(':common:common-db'))
implementation(project(':common:common-messagelog'))
implementation "org.bouncycastle:bcpkix-jdk15on:${bouncyCastleVersion}"
implementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
}

Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ private byte[] getTimestampedData() throws Exception {
private TimeStampToken getTimeStampToken() throws Exception {
String timestampDerBase64 = asic.getEntryAsString(ENTRY_TIMESTAMP);
byte[] tsDerDecoded = decodeBase64(timestampDerBase64);
return new TimeStampToken(new ContentInfo(
(ASN1Sequence) ASN1Sequence.fromByteArray(tsDerDecoded)));
return new TimeStampToken(ContentInfo.getInstance(ASN1Sequence.fromByteArray(tsDerDecoded)));
}

private static ClientId getSigner(String messageXml) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private AsicUtils() {
@SneakyThrows
public static String escapeString(String str) {
String urlEncoded =
URLEncoder.encode(str, StandardCharsets.UTF_8.name());
URLEncoder.encode(str, StandardCharsets.UTF_8);
return urlEncoded.replace("/", "%2F");
}

Expand Down
6 changes: 6 additions & 0 deletions src/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ configure(subprojects.findAll { !["shared-ui", "ui"].contains(it.name) }) {
require("$woodstoxVersion")
}
}
add('implementation', 'io.micrometer:micrometer-tracing-bridge-brave') {
because("Vulnerability fix regarding CVE-2022-47932")
version {
require("1.23.0")
}
}
}

testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
intTestImplementation("com.nortal.test:test-automation-allure:${testAutomationFrameworkVersion}")
intTestImplementation("com.nortal.test:test-automation-containers:${testAutomationFrameworkVersion}")
intTestImplementation("com.nortal.test:test-automation-feign:$testAutomationFrameworkVersion")
intTestImplementation("org.bouncycastle:bcpkix-jdk15on:${bouncyCastleVersion}")
intTestImplementation("org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}")
intTestImplementation("org.awaitility:awaitility:${awaitilityVersion}")
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/common-int-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
api("com.nortal.test:test-automation-selenide:${testAutomationFrameworkVersion}") {
exclude group: "org.slf4j", module: "*"
}
api("org.bouncycastle:bcpkix-jdk15on:${bouncyCastleVersion}")
api("org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}")
api("org.awaitility:awaitility:${awaitilityVersion}")
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/common-messagelog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies {
implementation project(':asic-util')

testImplementation project(':common:common-test')
testImplementation "org.bouncycastle:bcpg-jdk15on:${bouncyCastleVersion}"
testImplementation "org.bouncycastle:bcpg-jdk18on:${bouncyCastleVersion}"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/common-util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sourceSets {
dependencies {
//FIXME review dependencies
api 'org.apache.santuario:xmlsec:2.2.6'
api "org.bouncycastle:bcpkix-jdk15on:$bouncyCastleVersion"
api "org.bouncycastle:bcpkix-jdk18on:$bouncyCastleVersion"
api 'org.apache.commons:commons-lang3:3.12.0'
api 'commons-io:commons-io:2.13.0'
api "org.slf4j:jcl-over-slf4j:$slf4jVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.google.common.util.concurrent.UncheckedExecutionException;
import lombok.extern.slf4j.Slf4j;
import org.apache.xml.security.algorithms.MessageDigestAlgorithm;
import org.bouncycastle.asn1.DERBitString;
import org.bouncycastle.asn1.ocsp.ResponderID;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.ocsp.BasicOCSPResp;
Expand Down Expand Up @@ -351,7 +350,7 @@ public static X509Certificate getOcspCert(BasicOCSPResp response)
for (X509Certificate cert : knownCerts) {
X509CertificateHolder certHolder =
new X509CertificateHolder(cert.getEncoded());
DERBitString keyData =
var keyData =
certHolder.getSubjectPublicKeyInfo().getPublicKeyData();
byte[] d = calculateDigest(dc, keyData.getBytes());
if (MessageDigestAlgorithm.isEqual(respId.getKeyHash(), d)) {
Expand Down
7 changes: 4 additions & 3 deletions src/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ springBootVersion=3.2.2
springDependenciesVersion=1.1.4
nettyVersion=4.1.105.Final
netty.version=${nettyVersion}
micrometerTracingVersion=1.2.3
springCloudVersion=2023.0.0
openFeignVersion=12.3
junitJupiterVersion=5.10.2
Expand All @@ -45,7 +46,7 @@ systemRulesVersion=1.19.0
guavaVersion=33.0.0-jre
guava.version=${guavaVersion}
vavrVersion=0.10.4
bouncyCastleVersion=1.69
bouncyCastleVersion=1.77
tomcatVersion=10.1.18
tomcat.version=${tomcatVersion}
slf4jVersion=2.0.11
Expand All @@ -58,7 +59,7 @@ liquibaseVersion=4.25.0
liquibase.version=${liquibaseVersion}
lombokMapstructBinding=0.2.0
openApiGeneratorVersion=7.1.0
swaggerParserVersion=2.1.18
swaggerParserVersion=2.1.20
hsqldbVersion=2.7.1:jdk8
hsqldb.version=${hsqldbVersion}
commonsTextVersion=1.10.0
Expand All @@ -72,7 +73,7 @@ assertj.version=${assertjVersion}
swaggerAnnotationsVersion=2.2.17
protocVersion=3.24.3
protobufGradleVersion=0.9.4
grpcVersion=1.58.0
grpcVersion=1.61.1
libpam4jVersion=1.11
jakartaValidationApiVersion=3.0.2
jakartaServletApiVersion=6.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class InternalTlsCertificateServiceTest {
new ExternalProcessRunner() {
@Override
public ProcessResult execute(String command, String... args) throws ProcessNotExecutableException,
ProcessFailedException {
ProcessFailedException {
if (command.equals(MOCK_SUCCESS_SCRIPT)) {
return new ProcessResult(command, 0, Collections.singletonList(SUCCESS));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class DummyCertBuilder {

X509Certificate build(TokenAndKey tokenAndKey, GenerateSelfSignedCertReq message, PublicKey publicKey,
String signAlgoId) throws Exception {
X500Name subject = new X500Name("CN=" + message.getCommonName());
X500Name subject = new X500Name(message.getCommonName());

JcaX509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(subject, BigInteger.ONE,
fromUnixTimestamp(message.getDateNotBefore()),
Expand Down

0 comments on commit 19cbcf2

Please sign in to comment.