Skip to content

Commit ccf9d8b

Browse files
authored
CORE-18620: Add authentication protocol data (#1385)
* CORE-18620: Add authentication protocol data * Add more common fields * Add specific revocation mode enum * Rename header to common details * Rename field * Set the version to the correct version
1 parent 6fbc6c2 commit ccf9d8b

11 files changed

+370
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"type": "record",
3+
"name": "AuthenticatedEncryptionSessionDetails",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "outboundSecretKey",
8+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
9+
},
10+
{
11+
"name": "outboundNonce",
12+
"type": "bytes"
13+
},
14+
{
15+
"name": "inboundSecretKey",
16+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
17+
},
18+
{
19+
"name": "inboundNonce",
20+
"type": "bytes"
21+
}
22+
]
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"type": "record",
3+
"name": "AuthenticatedSessionDetails",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "outboundSecretKey",
8+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
9+
},
10+
{
11+
"name": "inboundSecretKey",
12+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
13+
}
14+
]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"type": "record",
3+
"name": "AuthenticationProtocolCommonDetails",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "sessionId",
8+
"type": "string"
9+
},
10+
{
11+
"name": "ourMaxMessageSize",
12+
"type": "int"
13+
},
14+
{
15+
"name": "session",
16+
"type": [
17+
"null",
18+
"net.corda.data.p2p.crypto.protocol.Session"
19+
]
20+
},
21+
{
22+
"name": "myPrivateDHKey",
23+
"type": [
24+
"null",
25+
"string"
26+
]
27+
},
28+
{
29+
"name": "myPublicDHKey",
30+
"type": [
31+
"null",
32+
"bytes"
33+
]
34+
},
35+
{
36+
"name": "peerPublicDHKey",
37+
"type": [
38+
"null",
39+
"string"
40+
]
41+
},
42+
{
43+
"name": "sharedDHSecret",
44+
"type": [
45+
"null",
46+
"bytes"
47+
]
48+
},
49+
{
50+
"name": "selectedMode",
51+
"type": [
52+
"null",
53+
"net.corda.data.p2p.crypto.ProtocolMode"
54+
]
55+
},
56+
{
57+
"name": "sharedHandshakeSecrets",
58+
"type": [
59+
"null",
60+
"net.corda.data.p2p.crypto.protocol.SharedHandshakeSecrets"
61+
]
62+
},
63+
{
64+
"name": "initiatorHelloMessage",
65+
"type": [
66+
"null",
67+
"net.corda.data.p2p.crypto.InitiatorHelloMessage"
68+
]
69+
},
70+
{
71+
"name": "responderHelloMessage",
72+
"type": [
73+
"null",
74+
"net.corda.data.p2p.crypto.ResponderHelloMessage"
75+
]
76+
},
77+
{
78+
"name": "initiatorHelloToResponderHelloBytes",
79+
"type": [
80+
"null",
81+
"bytes"
82+
]
83+
},
84+
{
85+
"name": "initiatorHandshakePayloadBytes",
86+
"type": [
87+
"null",
88+
"bytes"
89+
]
90+
},
91+
{
92+
"name": "responderHandshakePayloadBytes",
93+
"type": [
94+
"null",
95+
"bytes"
96+
]
97+
},
98+
{
99+
"name": "agreedMaxMessageSize",
100+
"type": [
101+
"null",
102+
"int"
103+
]
104+
}
105+
]
106+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"type": "record",
3+
"name": "AuthenticationProtocolInitiatorDetails",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "protocolCommonDetails",
8+
"type": "net.corda.data.p2p.crypto.protocol.AuthenticationProtocolCommonDetails"
9+
},
10+
{
11+
"name": "step",
12+
"type": {
13+
"type": "enum",
14+
"name": "InitiatorStep",
15+
"symbols" : [
16+
"INIT",
17+
"SENT_MY_DH_KEY",
18+
"RECEIVED_PEER_DH_KEY",
19+
"GENERATED_HANDSHAKE_SECRETS",
20+
"SENT_HANDSHAKE_MESSAGE",
21+
"RECEIVED_HANDSHAKE_MESSAGE",
22+
"SESSION_ESTABLISHED"
23+
]
24+
}
25+
},
26+
{
27+
"name": "supportedModes",
28+
"type": {
29+
"type": "array",
30+
"items": "net.corda.data.p2p.crypto.ProtocolMode"
31+
}
32+
},
33+
{
34+
"name": "ourPublicKey",
35+
"type": "string"
36+
},
37+
{
38+
"name": "groupId",
39+
"type": "string"
40+
},
41+
{
42+
"name": "certificateCheckMode",
43+
"type": [
44+
"null",
45+
"net.corda.data.p2p.crypto.protocol.CheckCertificate"
46+
]
47+
},
48+
{
49+
"name": "initiatorHandshakeMessage",
50+
"type": [
51+
"null",
52+
"net.corda.data.p2p.crypto.InitiatorHandshakeMessage"
53+
]
54+
}
55+
]
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"type": "record",
3+
"name": "AuthenticationProtocolResponderDetails",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "protocolCommonDetails",
8+
"type": "net.corda.data.p2p.crypto.protocol.AuthenticationProtocolCommonDetails"
9+
},
10+
{
11+
"name": "step",
12+
"type": {
13+
"type": "enum",
14+
"name": "ResponderStep",
15+
"symbols" : [
16+
"INIT",
17+
"RECEIVED_PEER_DH_KEY",
18+
"SENT_MY_DH_KEY",
19+
"GENERATED_HANDSHAKE_SECRETS",
20+
"RECEIVED_HANDSHAKE_MESSAGE",
21+
"VALIDATED_ENCRYPTED_EXTENSIONS",
22+
"SENT_HANDSHAKE_MESSAGE",
23+
"SESSION_ESTABLISHED"
24+
]
25+
}
26+
},
27+
{
28+
"name": "handshakeIdentityData",
29+
"type": [
30+
"null",
31+
"net.corda.data.p2p.crypto.protocol.HandshakeIdentityData"
32+
]
33+
},
34+
{
35+
"name": "responderHandshakeMessage",
36+
"type": [
37+
"null",
38+
"net.corda.data.p2p.crypto.ResponderHandshakeMessage"
39+
]
40+
},
41+
{
42+
"name": "encryptedExtensions",
43+
"type": [
44+
"null",
45+
"net.corda.data.p2p.crypto.internal.InitiatorEncryptedExtensions"
46+
]
47+
},
48+
{
49+
"name": "initiatorPublicKey",
50+
"type": [
51+
"null",
52+
"string"
53+
]
54+
}
55+
]
56+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"type": "record",
3+
"name": "CheckCertificate",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "truststore",
8+
"type": {
9+
"type": "array",
10+
"items": "string"
11+
}
12+
},
13+
{
14+
"name": "revocationCheckMode",
15+
"type": {
16+
"type": "enum",
17+
"name": "RevocationCheckMode",
18+
"symbols" : [
19+
"OFF",
20+
"SOFT_FAIL",
21+
"HARD_FAIL"
22+
]
23+
}
24+
}
25+
]
26+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"type": "record",
3+
"name": "HandshakeIdentityData",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "initiatorPublicKeyHash",
8+
"type": "bytes"
9+
},
10+
{
11+
"name": "responderPublicKeyHash",
12+
"type": "bytes"
13+
},
14+
{
15+
"name": "groupId",
16+
"type": "string"
17+
}
18+
]
19+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"type": "record",
3+
"name": "SecretKeySpec",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "algorithm",
8+
"type": "string"
9+
},
10+
{
11+
"name": "key",
12+
"type": "bytes"
13+
}
14+
]
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"type": "record",
3+
"name": "Session",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "sessionId",
8+
"type": "string"
9+
},
10+
{
11+
"name": "maxMessageSize",
12+
"type": "int"
13+
},
14+
{
15+
"name": "details",
16+
"type": [
17+
"net.corda.data.p2p.crypto.protocol.AuthenticatedSessionDetails",
18+
"net.corda.data.p2p.crypto.protocol.AuthenticatedEncryptionSessionDetails"
19+
]
20+
}
21+
]
22+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"type": "record",
3+
"name": "SharedHandshakeSecrets",
4+
"namespace": "net.corda.data.p2p.crypto.protocol",
5+
"fields": [
6+
{
7+
"name": "initiatorAuthKey",
8+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
9+
},
10+
{
11+
"name": "responderAuthKey",
12+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
13+
},
14+
{
15+
"name": "initiatorEncryptionKey",
16+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
17+
},
18+
{
19+
"name": "responderEncryptionKey",
20+
"type": "net.corda.data.p2p.crypto.protocol.SecretKeySpec"
21+
},
22+
{
23+
"name": "initiatorNonce",
24+
"type": "bytes"
25+
},
26+
{
27+
"name": "responderNonce",
28+
"type": "bytes"
29+
}
30+
]
31+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cordaProductVersion = 5.2.0
99
# NOTE: update this each time this module contains a breaking change
1010
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
1111
## a per module property in which case module versions can change independently.
12-
cordaApiRevision = 11
12+
cordaApiRevision = 12
1313

1414
# Main
1515
kotlinVersion = 1.8.21

0 commit comments

Comments
 (0)