Skip to content
Permalink
Browse files
[WebAuthn] Rename cable transport to hybrid
https://bugs.webkit.org/show_bug.cgi?id=241691
rdar://problem/95312126

Reviewed by Brent Fulgham.

This transport got renamed in fido-alliance/fido-2-specs#1332

Hybrid is the name that should be used in AuthenticatorTransport, we continue to recgnize
the old string.

* Source/WebCore/Modules/webauthn/AuthenticatorTransport.h:
* Source/WebCore/Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp:
(fido::toString):
* Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::convertStringToAuthenticatorTransport):
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticatorInternal::transports):
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:
(WebKit::toASCDescriptor):

Canonical link: https://commits.webkit.org/251621@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pascoej committed Jun 16, 2022
1 parent a4db7dd commit d31dfa454524d4aa4f23b23a59344eba0898b87f
Showing 6 changed files with 13 additions and 3 deletions.
@@ -36,7 +36,8 @@ enum class AuthenticatorTransport {
Nfc,
Ble,
Internal,
Cable
Cable,
Hybrid
};

} // namespace WebCore
@@ -50,7 +51,8 @@ template<> struct EnumTraits<WebCore::AuthenticatorTransport> {
WebCore::AuthenticatorTransport::Nfc,
WebCore::AuthenticatorTransport::Ble,
WebCore::AuthenticatorTransport::Internal,
WebCore::AuthenticatorTransport::Cable
WebCore::AuthenticatorTransport::Cable,
WebCore::AuthenticatorTransport::Hybrid
>;
};

@@ -95,6 +95,7 @@ constexpr auto authenticatorTransportNfc = "nfc"_s;
constexpr auto authenticatorTransportBle = "ble"_s;
constexpr auto authenticatorTransportInternal = "internal"_s;
constexpr auto authenticatorTransportCable = "cable"_s;
constexpr auto authenticatorTransportHybrid = "hybrid"_s;

} // namespace WebCore

@@ -100,6 +100,8 @@ static String toString(WebCore::AuthenticatorTransport transport)
break;
case WebCore::AuthenticatorTransport::Cable:
return WebCore::authenticatorTransportCable;
case WebCore::AuthenticatorTransport::Hybrid:
return WebCore::authenticatorTransportHybrid;
default:
break;
}
@@ -66,6 +66,8 @@ static std::optional<AuthenticatorTransport> convertStringToAuthenticatorTranspo
return AuthenticatorTransport::Internal;
if (transport == authenticatorTransportCable)
return AuthenticatorTransport::Cable;
if (transport == authenticatorTransportHybrid)
return AuthenticatorTransport::Hybrid;
return std::nullopt;
}

@@ -200,7 +200,7 @@ static inline uint8_t authDataFlags(ClientDataType type, LocalConnection::UserVe
{
Vector<WebCore::AuthenticatorTransport> transports = { WebCore::AuthenticatorTransport::Internal };
if (shouldUpdateQuery())
transports.append(WebCore::AuthenticatorTransport::Cable);
transports.append(WebCore::AuthenticatorTransport::Hybrid);
return transports;
}

@@ -157,6 +157,9 @@ static inline ExceptionCode toExceptionCode(NSInteger nsErrorCode)
case AuthenticatorTransport::Cable:
transportString = @"cable";
break;
case AuthenticatorTransport::Hybrid:
transportString = @"hybrid";
break;
}

if (transportString)

0 comments on commit d31dfa4

Please sign in to comment.