MySQL 8.4.2
Source Code Documentation
webauthn_assertion.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 Without limiting anything contained in the foregoing, this file,
16 which is part of C Driver for MySQL (Connector/C), is also subject to the
17 Universal FOSS Exception, version 1.0, a copy of which can be found at
18 http://oss.oracle.com/licenses/universal-foss-exception.
19
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License, version 2.0, for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
28
29#ifndef WEBAUTHN_ASSERTION_H_
30#define WEBAUTHN_ASSERTION_H_
31
32#include <string>
33
34#include <assertion.h>
35
36/**
37 Class to initiate authentication(aka assertion in FIDO terminology) on
38 client side by generating a signature by FIDO device which needs to be
39 sent to server to be verified using public key stored in auth_string.
40*/
42 public:
45 bool get_signed_challenge(unsigned char **challenge_res,
46 size_t &challenge_res_len) override;
47 void set_client_data(const unsigned char *, const char *) override;
48 bool sign_challenge() override;
49 bool parse_challenge(const unsigned char *challenge) override;
50 bool check_fido2_device(bool &is_fido2);
52 std::string get_client_data_json();
54
55 private:
57
58 private:
59 std::string m_client_data_json;
61};
62
63#endif // WEBAUTHN_ASSERTION_H_
Class to initiate authentication(aka assertion in FIDO terminology) on client side by generating a si...
Definition: assertion.h:40
Class to initiate authentication(aka assertion in FIDO terminology) on client side by generating a si...
Definition: webauthn_assertion.h:41
std::string m_client_data_json
Definition: webauthn_assertion.h:59
bool check_fido2_device(bool &is_fido2)
This method is called by webauthn_authentication_client plugin to check if the token device present o...
Definition: webauthn_assertion.cc:274
webauthn_assertion(bool preserve_privacy)
Definition: webauthn_assertion.h:43
std::string get_client_data_json()
Definition: webauthn_assertion.cc:299
bool sign_challenge() override
Method to obtains an assertion from a FIDO device.
Definition: webauthn_assertion.cc:146
size_t get_client_data_json_len()
Definition: webauthn_assertion.cc:295
bool get_signed_challenge(unsigned char **challenge_res, size_t &challenge_res_len) override
This method will construct challenge response which is passed to server.
Definition: webauthn_assertion.cc:98
bool select_credential_id()
Select credential ID from a list of resident keys and set it for assertion.
Definition: webauthn_assertion.cc:310
void set_client_data(const unsigned char *, const char *) override
Helper method to set client data context.
Definition: webauthn_assertion.cc:192
bool parse_challenge(const unsigned char *challenge) override
Helper method to parse the challenge received from server during authentication process.
Definition: webauthn_assertion.cc:231
bool m_preserve_privacy
Definition: webauthn_assertion.h:60
size_t calculate_client_response_length()
This method will calculate length of the buffer required for challenge response.
Definition: webauthn_assertion.cc:55
static bool preserve_privacy
Definition: webauthn_client_plugin.cc:44