Skip to content

Commit

Permalink
Fix bug when subjectSNs include PIVA (#159)
Browse files Browse the repository at this point in the history
* Fix bug when subjectSNs include PIVA

* Update src/main/scala/it/pagopa/interop/partyprocess/service/impl/SignatureValidationServiceImpl.scala

Co-authored-by: Stefano Perazzolo <[email protected]>

Co-authored-by: Stefano Perazzolo <[email protected]>
  • Loading branch information
andrea-putzu and beetlecrunch authored Sep 19, 2022
1 parent b58e753 commit 50f7232
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ case object SignatureValidationServiceImpl extends SignatureValidationService {
val subjectSerialNumbers: Either[SignatureValidationError, List[String]] = {
val subjectSNs: List[String] =
reports.getDiagnosticData.getUsedCertificates.asScala.toList.flatMap(c => Option(c.getSubjectSerialNumber))
if (subjectSNs.nonEmpty) Right(subjectSNs) else Left(TaxCodeNotFoundInSignature)
val subjectSNCFs: List[String] = subjectSNs.filter(signatureRegex.matches)
if (subjectSNCFs.nonEmpty) Right(subjectSNCFs) else Left(TaxCodeNotFoundInSignature)
}

for {
Expand Down

0 comments on commit 50f7232

Please sign in to comment.