Skip to content

Commit

Permalink
Merge pull request #8 from minvws/chore/update-gradle
Browse files Browse the repository at this point in the history
update gradle
  • Loading branch information
Rool authored Aug 6, 2023
2 parents 549e907 + f515f05 commit 765ebd7
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'temurin'
- name: Show java version
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Oct 21 14:50:24 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ object CMSSignatureValidatorBuilder {
cnMatchingString: String? = null,
clock: Clock
): CMSSignatureValidatorImpl {

return CMSSignatureValidatorImpl(
signingCertificates = emptyList(),
trustAnchors = trustCertificates(certificatesPem),
Expand Down Expand Up @@ -55,7 +54,6 @@ object CMSSignatureValidatorBuilder {
certificatesPem: List<String>,
signingCertificates: List<X509Certificate>
): CMSSignatureValidatorImpl {

return CMSSignatureValidatorImpl(
signingCertificates = signingCertificates,
trustAnchors = trustCertificates(certificatesPem),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class CMSSignatureValidatorImpl internal constructor(
val sp = CMSSignedDataParser(
JcaDigestCalculatorProviderBuilder().setProvider(provider)
.build(),
CMSTypedStream(BufferedInputStream(content)), signature
CMSTypedStream(BufferedInputStream(content)),
signature
)

sp.signedContent.drain()
Expand All @@ -71,7 +72,8 @@ class CMSSignatureValidatorImpl internal constructor(
if (this.signingCertificates.all {
val expiringTime = it.notAfter.time
nowMs > expiringTime
}) {
}
) {
throw SignatureValidationException("Expired certificate")
}
}
Expand All @@ -89,7 +91,8 @@ class CMSSignatureValidatorImpl internal constructor(
.map { IETFUtils.valueToString(it.first.value) }
if (!subjectRDNs.any {
it.endsWith(matchingString)
}) {
}
) {
throw SignatureValidationException("Signing certificate does not match expected CN")
}
}
Expand Down
Loading

0 comments on commit 765ebd7

Please sign in to comment.