14
14
namespace aos ::cloudprotocol {
15
15
16
16
/* *
17
- * StartProvisioningRequest message .
17
+ * CSR info .
18
18
*/
19
- struct StartProvisioningRequest {
20
- Identity mNodeID ;
21
- StaticString<cCertSecretSize> mPassword ;
19
+ struct CSRInfo {
20
+ CertType mType ;
21
+ StaticString<crypto::cCSRPEMLen> mCSR ;
22
22
23
23
/* *
24
- * Compares start provisioning request .
24
+ * Compares CSR info .
25
25
*
26
- * @param other object to compare with.
26
+ * @param other CSR info to compare with.
27
27
* @return bool.
28
28
*/
29
- bool operator ==(const StartProvisioningRequest& other) const
30
- {
31
- return mNodeID == other.mNodeID && mPassword == other.mPassword ;
32
- }
29
+ bool operator ==(const CSRInfo& other) const { return mType == other.mType && mCSR == other.mCSR ; }
33
30
34
31
/* *
35
- * Compares start provisioning request .
32
+ * Compares CSR info .
36
33
*
37
- * @param other object to compare with.
34
+ * @param other CSR info to compare with.
38
35
* @return bool.
39
36
*/
40
- bool operator !=(const StartProvisioningRequest & other) const { return !operator ==(other); }
37
+ bool operator !=(const CSRInfo & other) const { return !operator ==(other); }
41
38
};
42
39
40
+ using CSRInfoArray = StaticArray<CSRInfo, cCertsPerNodeCount>;
41
+
43
42
/* *
44
- * CSR info.
43
+ * Certificate info.
45
44
*/
46
- struct CSRInfo {
47
- CertType mType ;
48
- StaticString<crypto::cCSRPEMLen> mCsr ;
45
+ struct CertInfo {
46
+ CertType mCertType ;
47
+ StaticString<crypto::cCertChainPEMLen> mCertChain ;
49
48
50
49
/* *
51
- * Compares CSR info.
50
+ * Compares certificate info.
52
51
*
53
- * @param other CSR info to compare with.
52
+ * @param other object to compare with.
54
53
* @return bool.
55
54
*/
56
- bool operator ==(const CSRInfo& other) const { return mType == other.mType && mCsr == other.mCsr ; }
55
+ bool operator ==(const CertInfo& other) const
56
+ {
57
+ return mCertType == other.mCertType && mCertChain == other.mCertChain ;
58
+ }
57
59
58
60
/* *
59
- * Compares CSR info.
61
+ * Compares certificate info.
60
62
*
61
- * @param other CSR info to compare with.
63
+ * @param other object to compare with.
62
64
* @return bool.
63
65
*/
64
- bool operator !=(const CSRInfo & other) const { return !operator ==(other); }
66
+ bool operator !=(const CertInfo & other) const { return !operator ==(other); }
65
67
};
66
68
67
- using CSRInfoArray = StaticArray<CSRInfo , cCertsPerNodeCount>;
69
+ using CertInfoArray = StaticArray<CertInfo , cCertsPerNodeCount>;
68
70
69
71
/* *
70
- * StartProvisioningResponse message .
72
+ * Start provisioning request .
71
73
*/
72
- struct StartProvisioningResponse {
73
- Identity mNodeID ;
74
- Error mError ;
75
- CSRInfoArray mCSRs ;
74
+ struct StartProvisioningRequest {
75
+ Identity mNode ;
76
+ StaticString<cCertSecretSize> mPassword ;
76
77
77
78
/* *
78
- * Compares start provisioning response .
79
+ * Compares start provisioning request .
79
80
*
80
81
* @param other object to compare with.
81
82
* @return bool.
82
83
*/
83
- bool operator ==(const StartProvisioningResponse & other) const
84
+ bool operator ==(const StartProvisioningRequest & other) const
84
85
{
85
- return mNodeID == other.mNodeID && mError == other.mError && mCSRs == other. mCSRs ;
86
+ return mNode == other.mNode && mPassword == other.mPassword ;
86
87
}
87
88
88
89
/* *
89
- * Compares start provisioning response .
90
+ * Compares start provisioning request .
90
91
*
91
92
* @param other object to compare with.
92
93
* @return bool.
93
94
*/
94
- bool operator !=(const StartProvisioningResponse & other) const { return !operator ==(other); }
95
+ bool operator !=(const StartProvisioningRequest & other) const { return !operator ==(other); }
95
96
};
96
97
97
98
/* *
98
- * Certificate info .
99
+ * Start provisioning response .
99
100
*/
100
- struct CertInfo {
101
- CertType mType ;
102
- StaticString<crypto::cCertChainPEMLen> mCertificateChain ;
101
+ struct StartProvisioningResponse {
102
+ Identity mNode ;
103
+ CSRInfoArray mCSRs ;
104
+ Error mError ;
103
105
104
106
/* *
105
- * Compares certificate info .
107
+ * Compares start provisioning response .
106
108
*
107
109
* @param other object to compare with.
108
110
* @return bool.
109
111
*/
110
- bool operator ==(const CertInfo & other) const
112
+ bool operator ==(const StartProvisioningResponse & other) const
111
113
{
112
- return mType == other.mType && mCertificateChain == other.mCertificateChain ;
114
+ return mNode == other.mNode && mCSRs == other.mCSRs && mError == other. mError ;
113
115
}
114
116
115
117
/* *
116
- * Compares certificate info .
118
+ * Compares start provisioning response .
117
119
*
118
120
* @param other object to compare with.
119
121
* @return bool.
120
122
*/
121
- bool operator !=(const CertInfo & other) const { return !operator ==(other); }
123
+ bool operator !=(const StartProvisioningResponse & other) const { return !operator ==(other); }
122
124
};
123
125
124
- using CertInfoArray = StaticArray<CertInfo, cCertsPerNodeCount>;
125
-
126
126
/* *
127
127
* FinishProvisioningRequest message.
128
128
*/
129
129
struct FinishProvisioningRequest {
130
- Identity mNodeID ;
130
+ Identity mNode ;
131
131
CertInfoArray mCertificates ;
132
132
StaticString<cCertSecretSize> mPassword ;
133
133
@@ -139,7 +139,7 @@ struct FinishProvisioningRequest {
139
139
*/
140
140
bool operator ==(const FinishProvisioningRequest& other) const
141
141
{
142
- return mNodeID == other.mNodeID && mCertificates == other.mCertificates && mPassword == other.mPassword ;
142
+ return mNode == other.mNode && mCertificates == other.mCertificates && mPassword == other.mPassword ;
143
143
}
144
144
145
145
/* *
@@ -155,7 +155,7 @@ struct FinishProvisioningRequest {
155
155
* FinishProvisioningResponse message.
156
156
*/
157
157
struct FinishProvisioningResponse {
158
- Identity mNodeID ;
158
+ Identity mNode ;
159
159
Error mError ;
160
160
161
161
/* *
@@ -166,7 +166,7 @@ struct FinishProvisioningResponse {
166
166
*/
167
167
bool operator ==(const FinishProvisioningResponse& other) const
168
168
{
169
- return mNodeID == other.mNodeID && mError == other.mError ;
169
+ return mNode == other.mNode && mError == other.mError ;
170
170
}
171
171
172
172
/* *
@@ -182,7 +182,7 @@ struct FinishProvisioningResponse {
182
182
* DeprovisioningRequest message.
183
183
*/
184
184
struct DeprovisioningRequest {
185
- Identity mNodeID ;
185
+ Identity mNode ;
186
186
StaticString<cCertSecretSize> mPassword ;
187
187
188
188
/* *
@@ -193,7 +193,7 @@ struct DeprovisioningRequest {
193
193
*/
194
194
bool operator ==(const DeprovisioningRequest& other) const
195
195
{
196
- return mNodeID == other.mNodeID && mPassword == other.mPassword ;
196
+ return mNode == other.mNode && mPassword == other.mPassword ;
197
197
}
198
198
199
199
/* *
@@ -209,7 +209,7 @@ struct DeprovisioningRequest {
209
209
* DeprovisioningRequest message.
210
210
*/
211
211
struct DeprovisioningResponse {
212
- Identity mNodeID ;
212
+ Identity mNode ;
213
213
Error mError ;
214
214
215
215
/* *
@@ -220,7 +220,7 @@ struct DeprovisioningResponse {
220
220
*/
221
221
bool operator ==(const DeprovisioningResponse& other) const
222
222
{
223
- return mNodeID == other.mNodeID && mError == other.mError ;
223
+ return mNode == other.mNode && mError == other.mError ;
224
224
}
225
225
226
226
/* *
0 commit comments