mirror of
https://github.com/corda/corda.git
synced 2025-01-31 00:24:59 +00:00
Ban common name. (#1568)
This commit is contained in:
parent
0314e650a4
commit
d1e5fbb73d
@ -155,7 +155,7 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
|
||||
* or has loaded network map data from local database */
|
||||
val nodeReadyFuture: CordaFuture<Unit>
|
||||
get() = _nodeReadyFuture
|
||||
|
||||
/** A [CordaX500Name] with null common name. */
|
||||
protected val myLegalName: CordaX500Name by lazy {
|
||||
val cert = loadKeyStore(configuration.nodeKeystore, configuration.keyStorePassword).getX509Certificate(X509Utilities.CORDA_CLIENT_CA)
|
||||
CordaX500Name.build(cert.subjectX500Principal).copy(commonName = null)
|
||||
@ -643,7 +643,7 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
|
||||
|
||||
val (id, name) = if (serviceInfo == null) {
|
||||
// Create node identity if service info = null
|
||||
Pair("identity", myLegalName.copy(commonName = null))
|
||||
Pair("identity", myLegalName)
|
||||
} else {
|
||||
val name = serviceInfo.name ?: myLegalName.copy(commonName = serviceInfo.type.id)
|
||||
Pair(serviceInfo.type.id, name)
|
||||
|
@ -79,6 +79,7 @@ data class FullNodeConfiguration(
|
||||
rpcUsers.forEach {
|
||||
require(it.username.matches("\\w+".toRegex())) { "Username ${it.username} contains invalid characters" }
|
||||
}
|
||||
require(myLegalName.commonName == null) { "Common name must be null: $myLegalName" }
|
||||
}
|
||||
|
||||
fun calculateServices(): Set<ServiceInfo> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user