From cb07bcf0db231184d6b53845b26e06f56315ad94 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 30 Nov 2025 07:41:55 +0300 Subject: [PATCH] Added initial dummy platform files for passkeys. --- Telegram/CMakeLists.txt | 4 ++ .../platform/linux/webauthn_linux.cpp | 29 +++++++++++++ .../SourceFiles/platform/mac/webauthn_mac.mm | 29 +++++++++++++ .../SourceFiles/platform/platform_webauthn.h | 41 +++++++++++++++++++ .../SourceFiles/platform/win/webauthn_win.cpp | 29 +++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 Telegram/SourceFiles/platform/linux/webauthn_linux.cpp create mode 100644 Telegram/SourceFiles/platform/mac/webauthn_mac.mm create mode 100644 Telegram/SourceFiles/platform/platform_webauthn.h create mode 100644 Telegram/SourceFiles/platform/win/webauthn_win.cpp diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index ed41b8e676..26a0df4a93 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1401,6 +1401,7 @@ PRIVATE platform/linux/specific_linux.h platform/linux/tray_linux.cpp platform/linux/tray_linux.h + platform/linux/webauthn_linux.cpp platform/mac/file_utilities_mac.mm platform/mac/file_utilities_mac.h platform/mac/launcher_mac.mm @@ -1420,6 +1421,7 @@ PRIVATE platform/mac/specific_mac_p.h platform/mac/tray_mac.mm platform/mac/tray_mac.h + platform/mac/webauthn_mac.mm platform/mac/window_title_mac.mm platform/mac/touchbar/items/mac_formatter_item.h platform/mac/touchbar/items/mac_formatter_item.mm @@ -1454,6 +1456,7 @@ PRIVATE platform/win/specific_win.h platform/win/tray_win.cpp platform/win/tray_win.h + platform/win/webauthn_win.cpp platform/win/windows_app_user_model_id.cpp platform/win/windows_app_user_model_id.h platform/win/windows_dlls.cpp @@ -1472,6 +1475,7 @@ PRIVATE platform/platform_overlay_widget.h platform/platform_specific.h platform/platform_tray.h + platform/platform_webauthn.h platform/platform_window_title.h profile/profile_back_button.cpp profile/profile_back_button.h diff --git a/Telegram/SourceFiles/platform/linux/webauthn_linux.cpp b/Telegram/SourceFiles/platform/linux/webauthn_linux.cpp new file mode 100644 index 0000000000..470596117f --- /dev/null +++ b/Telegram/SourceFiles/platform/linux/webauthn_linux.cpp @@ -0,0 +1,29 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ + +#include "platform/platform_webauthn.h" + +namespace Platform::WebAuthn { + +bool IsSupported() { + return false; +} + +void RegisterKey( + const Data::Passkey::RegisterData &data, + Fn callback) { + callback({}); +} + +void Login( + const Data::Passkey::LoginData &data, + Fn callback) { + callback({}); +} + +} // namespace Platform::WebAuthn diff --git a/Telegram/SourceFiles/platform/mac/webauthn_mac.mm b/Telegram/SourceFiles/platform/mac/webauthn_mac.mm new file mode 100644 index 0000000000..470596117f --- /dev/null +++ b/Telegram/SourceFiles/platform/mac/webauthn_mac.mm @@ -0,0 +1,29 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ + +#include "platform/platform_webauthn.h" + +namespace Platform::WebAuthn { + +bool IsSupported() { + return false; +} + +void RegisterKey( + const Data::Passkey::RegisterData &data, + Fn callback) { + callback({}); +} + +void Login( + const Data::Passkey::LoginData &data, + Fn callback) { + callback({}); +} + +} // namespace Platform::WebAuthn diff --git a/Telegram/SourceFiles/platform/platform_webauthn.h b/Telegram/SourceFiles/platform/platform_webauthn.h new file mode 100644 index 0000000000..46b999bd97 --- /dev/null +++ b/Telegram/SourceFiles/platform/platform_webauthn.h @@ -0,0 +1,41 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ + +#pragma once + +namespace Data::Passkey { +struct RegisterData; +struct LoginData; +} // namespace Data::Passkey + +namespace Platform::WebAuthn { + +struct LoginResult { + QByteArray clientDataJSON; + QByteArray credentialId; + QByteArray authenticatorData; + QByteArray signature; + QByteArray userHandle; +}; + +struct RegisterResult { + QByteArray credentialId; + QByteArray attestationObject; + QByteArray clientDataJSON; + bool success = false; +}; + +[[nodiscard]] bool IsSupported(); +void RegisterKey( + const Data::Passkey::RegisterData &data, + Fn callback); +void Login( + const Data::Passkey::LoginData &data, + Fn callback); + +} // namespace Platform::WebAuthn diff --git a/Telegram/SourceFiles/platform/win/webauthn_win.cpp b/Telegram/SourceFiles/platform/win/webauthn_win.cpp new file mode 100644 index 0000000000..470596117f --- /dev/null +++ b/Telegram/SourceFiles/platform/win/webauthn_win.cpp @@ -0,0 +1,29 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ + +#include "platform/platform_webauthn.h" + +namespace Platform::WebAuthn { + +bool IsSupported() { + return false; +} + +void RegisterKey( + const Data::Passkey::RegisterData &data, + Fn callback) { + callback({}); +} + +void Login( + const Data::Passkey::LoginData &data, + Fn callback) { + callback({}); +} + +} // namespace Platform::WebAuthn