mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
adding except to the X500 name string to allow = and , in the name
This commit is contained in:
parent
550be76787
commit
d69fd01b3e
@ -109,6 +109,22 @@ class DBCertificateRequestStorageTest {
|
|||||||
assertThat(storage.getResponse(requestId2)).isInstanceOf(CertificateResponse.Ready::class.java)
|
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<CertificationRequestData, KeyPair> {
|
private fun createRequest(legalName: String): Pair<CertificationRequestData, KeyPair> {
|
||||||
val keyPair = Crypto.generateKeyPair(DEFAULT_TLS_SIGNATURE_SCHEME)
|
val keyPair = Crypto.generateKeyPair(DEFAULT_TLS_SIGNATURE_SCHEME)
|
||||||
val request = CertificationRequestData(
|
val request = CertificationRequestData(
|
||||||
|
Loading…
Reference in New Issue
Block a user