forked from Samsung/TizenFX
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAuthn] Enable concurrent Authenticator requests where supported b…
…y the native API (Samsung#6389) Make concurrent calls forwarded unconditionally. It is now up to the native API whether it will honor the request or return an error. Additionally, fix an error in AuthenticatorAssertionResponse data marshalling.
- Loading branch information
Showing
6 changed files
with
351 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/Tizen.Security.WebAuthn/Tizen.Security.WebAuthn/AuthenticatorGetAssertionStorage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License | ||
*/ | ||
|
||
using static Interop; | ||
|
||
namespace Tizen.Security.WebAuthn | ||
{ | ||
internal class AuthenticatorGetAssertionStorage : AuthenticatorStorage | ||
{ | ||
private WauthnGaOnResponseCallback _responseCallback; | ||
private bool _disposed = false; | ||
|
||
public AuthenticatorGetAssertionStorage(ClientData clientData, PubkeyCredRequestOptions options) | ||
{ | ||
CopyClientData(clientData); | ||
CopyCredRequestOptions(options); | ||
} | ||
|
||
public void SetCallbacks( | ||
WauthnDisplayQrcodeCallback qrcodeCallback, | ||
WauthnGaOnResponseCallback responseCallback, | ||
WauthnUpdateLinkedDataCallback linkedDataCallback) | ||
{ | ||
_qrcodeCallback = qrcodeCallback; | ||
_responseCallback = responseCallback; | ||
_linkedDataCallback = linkedDataCallback; | ||
|
||
WauthnGaCallbacks = new WauthnGaCallbacks(_qrcodeCallback, _responseCallback, _linkedDataCallback); | ||
} | ||
|
||
public override void Dispose() | ||
{ | ||
if (_disposed) | ||
return; | ||
|
||
base.Dispose(); | ||
|
||
_disposed = true; | ||
} | ||
|
||
private void CopyCredRequestOptions(PubkeyCredRequestOptions options) | ||
{ | ||
CopyCredentials(options.AllowCredentials); | ||
CopyHints(options.Hints); | ||
CopyAttestationFormats(options.AttestationFormats); | ||
CopyExtensions(options.Extensions); | ||
CopyLinkedDevice(options.LinkedDevice); | ||
WauthnPubkeyCredRequestOptions = new WauthnPubkeyCredRequestOptions( | ||
(nuint)options.Timeout, | ||
options.RpId, | ||
_credentialsUnmanaged, | ||
options.UserVerification, | ||
_hintsUnmanaged, | ||
options.Attestation, | ||
_attestationFormatsUnmanaged, | ||
_extensionsUnmanaged, | ||
_linkedDeviceUnmanaged); | ||
} | ||
|
||
public WauthnGaCallbacks WauthnGaCallbacks { get; private set; } | ||
public WauthnPubkeyCredRequestOptions WauthnPubkeyCredRequestOptions { get; private set; } | ||
} | ||
} |
Oops, something went wrong.