Skip to content

Commit 3a9fba9

Browse files
committed
attestedtls: new protocol
Use simple cbor-encoded protocol for clean connection establishment and shutdown and errors and to prepare for caching mechanism to reduce data to be sent. Signed-off-by: Simon Ott <[email protected]>
1 parent 837ceac commit 3a9fba9

File tree

15 files changed

+342
-163
lines changed

15 files changed

+342
-163
lines changed

Diff for: api/api.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func Receive(conn net.Conn) ([]byte, uint32, error) {
255255
payloadLen, MaxMsgLen)
256256
}
257257

258-
log.Tracef("Decoded header. Type %v, length %v", TypeToString(msgType), payloadLen)
258+
log.Tracef("Received header type %v. Receiving payload length %v", TypeToString(msgType), payloadLen)
259259

260260
// Read payload
261261
payload := bytes.NewBuffer(nil)
@@ -269,8 +269,6 @@ func Receive(conn net.Conn) ([]byte, uint32, error) {
269269
received += n
270270
payload.Write(chunk[:n])
271271

272-
log.Tracef("Received chunk of %v bytes\n", n)
273-
274272
if received == payloadLen {
275273
break
276274
}

Diff for: attestedhttp/client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type Transport struct {
5757
// as we enforce aTLS as the underlying transport protocol
5858

5959
// Additional aTLS parameters
60-
Attest string
60+
Attest atls.AttestSelect
6161
MutualTls bool
6262
CmcAddr string
6363
CmcApi atls.CmcApiSelect
@@ -154,7 +154,7 @@ func prepareClient(c *Client) error {
154154
if c.client == nil {
155155

156156
// Store aTLS and CMC configuration
157-
cmcConfig.Attest = atls.GetAttestMode(c.Transport.Attest)
157+
cmcConfig.Attest = c.Transport.Attest
158158
cmcConfig.Ca = c.Transport.Ca
159159
cmcConfig.Cmc = c.Transport.Cmc
160160
cmcConfig.CmcAddr = c.Transport.CmcAddr

Diff for: attestedhttp/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Server struct {
3030
*http.Server
3131

3232
// Additional aTLS parameters
33-
Attest string
33+
Attest atls.AttestSelect
3434
MutualTls bool
3535
CmcAddr string
3636
CmcApi atls.CmcApiSelect

0 commit comments

Comments
 (0)