From d69fd01b3e885315a0ddbe4cab590394f0253a52 Mon Sep 17 00:00:00 2001 From: Patrick Kuo Date: Fri, 12 May 2017 10:45:59 +0100 Subject: [PATCH] adding except to the X500 name string to allow = and , in the name --- .../DBCertificateRequestStorageTest.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doorman/src/test/kotlin/com/r3/corda/doorman/internal/persistence/DBCertificateRequestStorageTest.kt b/doorman/src/test/kotlin/com/r3/corda/doorman/internal/persistence/DBCertificateRequestStorageTest.kt index 93baf592da..a5d722a85d 100644 --- a/doorman/src/test/kotlin/com/r3/corda/doorman/internal/persistence/DBCertificateRequestStorageTest.kt +++ b/doorman/src/test/kotlin/com/r3/corda/doorman/internal/persistence/DBCertificateRequestStorageTest.kt @@ -109,6 +109,22 @@ class DBCertificateRequestStorageTest { assertThat(storage.getResponse(requestId2)).isInstanceOf(CertificateResponse.Ready::class.java) } + @Test + fun `request with equals symbol in legal name`() { + val requestId = storage.saveRequest(createRequest("Bank\\=A").first) + assertThat(storage.getPendingRequestIds()).isEmpty() + val response = storage.getResponse(requestId) as CertificateResponse.Unauthorised + assertThat(response.message).contains("=") + } + + @Test + fun `request with comma in legal name`() { + val requestId = storage.saveRequest(createRequest("Bank\\,A").first) + assertThat(storage.getPendingRequestIds()).isEmpty() + val response = storage.getResponse(requestId) as CertificateResponse.Unauthorised + assertThat(response.message).contains(",") + } + private fun createRequest(legalName: String): Pair { val keyPair = Crypto.generateKeyPair(DEFAULT_TLS_SIGNATURE_SCHEME) val request = CertificationRequestData(