Skip to content

Commit 64ae734

Browse files
feat(protocol): cable transport
This adds a remapping for the cable transport which has been observed in the wild, even though it has not been ratified and only exited for a short while before it was renamed.
1 parent fec4ca1 commit 64ae734

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

protocol/attestation.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ func (ccr *AuthenticatorAttestationResponse) Parse() (p *ParsedAttestationRespon
114114
}
115115

116116
for _, t := range ccr.Transports {
117-
p.Transports = append(p.Transports, AuthenticatorTransport(t))
117+
if transport, ok := internalRemappedAuthenticatorTransport[t]; ok {
118+
p.Transports = append(p.Transports, transport)
119+
} else {
120+
p.Transports = append(p.Transports, AuthenticatorTransport(t))
121+
}
118122
}
119123

120124
return p, nil

protocol/const.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ const (
99
stmtCertInfo = "certInfo"
1010
stmtPubArea = "pubArea"
1111
)
12+
13+
var (
14+
// internalRemappedAuthenticatorTransport handles remapping of AuthenticatorTransport values. Specifically it is
15+
// intentional on remapping only transports that never made recommendation but are being used in the wild. It
16+
// should not be used to handle transports that were ratified.
17+
internalRemappedAuthenticatorTransport = map[string]AuthenticatorTransport{
18+
// The Authenticator Transport 'hybrid' was previously named 'cable'; even if it was for a short period.
19+
"cable": Hybrid,
20+
}
21+
)

0 commit comments

Comments
 (0)