* @since_tizen 9.0
*/
typedef enum __wauthn_attestation_pref {
- ap_none = 0, /**< none */
- ap_indirect = 1, /**< "indirect" */
- ap_direct = 2, /**< "direct" */
- ap_enterprise = 3, /**< "enterprise" */
+ AP_NONE = 0, /**< none */
+ AP_INDIRECT = 1, /**< "indirect" */
+ AP_DIRECT = 2, /**< "direct" */
+ AP_ENTERPRISE = 3, /**< "enterprise" */
} wauthn_attestation_pref_e;
/**
* @since_tizen 9.0
*/
typedef enum __wauthn_pubkey_cred_hint {
- pch_none = 0, /**< none */
- pch_security_key = 1, /**< "security-key" */
- pch_client_device = 2, /**< "client-device" */
- pch_hybrid = 3, /**< "hybrid" */
+ PCH_NONE = 0, /**< none */
+ PCH_SECURITY_KEY = 1, /**< "security-key" */
+ PCH_CLIENT_DEVICE = 2, /**< "client-device" */
+ PCH_HYBRID = 3, /**< "hybrid" */
} wauthn_pubkey_cred_hint_e;
/**
* @since_tizen 9.0
*/
typedef enum __wauthn_user_verification_requirement {
- uvr_none = 0, /**< none */
- uvr_required = 1, /**< "required" */
- uvr_preferred = 2, /**< "preferred" */
- uvr_discouraged = 3, /**< "discouraged" */
+ UVR_NONE = 0, /**< none */
+ UVR_REQUIRED = 1, /**< "required" */
+ UVR_PREFERRED = 2, /**< "preferred" */
+ UVR_DISCOURAGED = 3, /**< "discouraged" */
} wauthn_user_verification_requirement_e;
/**
* @since_tizen 9.0
*/
typedef enum __wauthn_resident_key_requirement {
- rkr_none = 0, /**< none */
- rkr_discouraged = 1, /**< "discouraged" */
- rkr_preferred = 2, /**< "preferred" */
- rkr_required = 3, /**< "required" */
+ RKR_NONE = 0, /**< none */
+ RKR_DISCOURAGED = 1, /**< "discouraged" */
+ RKR_PREFERRED = 2, /**< "preferred" */
+ RKR_REQUIRED = 3, /**< "required" */
} wauthn_resident_key_requirement_e;
/**
* @since_tizen 9.0
*/
typedef enum __wauthn_authenticator_attachment {
- aa_none = 0, /**< none */
- aa_platform = 1, /**< "platform" */
- aa_cross_platform = 2, /**< "cross-platform" */
+ AA_NONE = 0, /**< none */
+ AA_PLATFORM = 1, /**< "platform" */
+ AA_CROSS_PLATFORM = 2, /**< "cross-platform" */
} wauthn_authenticator_attachment_e;
/**
* @since_tizen 9.0
*/
typedef enum __wauthn_pubkey_cred_type {
- pct_public_key = 1, /**< public-key */
+ PCT_PUBLIC_KEY = 1, /**< public-key */
} wauthn_pubkey_cred_type_e;
/**
guide the user agent in interacting with the user. (optional)*/
wauthn_attestation_pref_e attestation; /**<
The Relying Party MAY use this member to specify a preference regarding attestation
- conveyance. The default value is #ap_none (optional) */
+ conveyance. The default value is #AP_NONE (optional) */
wauthn_attestation_formats_s *attestation_formats; /**<
The Relying Party MAY use this member to specify a preference regarding the attestation
statement format used by the authenticator. The default value is the empty list, which
wauthn_user_verification_requirement_e user_verification; /**<
This member specifies the Relying Party's requirements regarding
user verification for the wauthn_get_assertion() operation.
- The default value is #uvr_preferred (optional) */
+ The default value is #UVR_PREFERRED (optional) */
wauthn_pubkey_cred_hints_s *hints; /**<
This member contains zero or more elements from #wauthn_pubkey_cred_hint_e to
guide the user agent in interacting with the user. (optional)*/
wauthn_attestation_pref_e attestation; /**<
The Relying Party MAY use this member to specify a preference regarding
- attestation conveyance. The default value is #ap_none (optional)*/
+ attestation conveyance. The default value is #AP_NONE (optional)*/
wauthn_attestation_formats_s *attestation_formats; /**<
The Relying Party MAY use this member to specify a preference regarding the attestation
statement format used by the authenticator. The default value is the empty list, which
// For wauthn_pubkey_cred_param_s
void __checkValidity(const wauthn_pubkey_cred_type_e type) {
- if (type != pct_public_key)
+ if (type != PCT_PUBLIC_KEY)
ThrowMsg(SerializationException::InvalidStreamData,
"Invalid wauthn_pubkey_cred_type_e: type=" << type);
}
// For wauthn_authenticator_sel_cri_s
void __checkValidity(const wauthn_authenticator_attachment_e attachment) {
switch(attachment) {
- case aa_none:
- case aa_platform:
- case aa_cross_platform:
+ case AA_NONE:
+ case AA_PLATFORM:
+ case AA_CROSS_PLATFORM:
return;
default:
ThrowMsg(SerializationException::InvalidStreamData,
}
void __checkValidity(const wauthn_resident_key_requirement_e resident_key) {
switch(resident_key) {
- case rkr_none:
- case rkr_discouraged:
- case rkr_preferred:
- case rkr_required:
+ case RKR_NONE:
+ case RKR_DISCOURAGED:
+ case RKR_PREFERRED:
+ case RKR_REQUIRED:
return;
default:
ThrowMsg(SerializationException::InvalidStreamData,
}
void __checkValidity(const wauthn_user_verification_requirement_e user_verification) {
switch(user_verification) {
- case uvr_none:
- case uvr_required:
- case uvr_preferred:
- case uvr_discouraged:
+ case UVR_NONE:
+ case UVR_REQUIRED:
+ case UVR_PREFERRED:
+ case UVR_DISCOURAGED:
return;
default:
ThrowMsg(SerializationException::InvalidStreamData,
if (hint == nullptr)
return;
switch(*hint) {
- case pch_none:
- case pch_security_key:
- case pch_client_device:
- case pch_hybrid:
+ case PCH_NONE:
+ case PCH_SECURITY_KEY:
+ case PCH_CLIENT_DEVICE:
+ case PCH_HYBRID:
return;
default:
ThrowMsg(SerializationException::InvalidStreamData,
// For wauthn_pubkey_cred_creation_options_s
void __checkValidity(wauthn_attestation_pref_e attestation) {
switch(attestation) {
- case ap_none:
- case ap_indirect:
- case ap_direct:
- case ap_enterprise:
+ case AP_NONE:
+ case AP_INDIRECT:
+ case AP_DIRECT:
+ case AP_ENTERPRISE:
return;
default:
ThrowMsg(SerializationException::InvalidStreamData,
sleep(2);
wauthn_pubkey_credential_attestaion_s *pubkey_cred =
(wauthn_pubkey_credential_attestaion_s*) calloc(1, sizeof(wauthn_pubkey_credential_attestaion_s));
- pubkey_cred->type = pct_public_key;
+ pubkey_cred->type = PCT_PUBLIC_KEY;
callbacks->response_callback(pubkey_cred, WAUTHN_ERROR_NONE, callbacks->user_data);
}
sleep(2);
wauthn_pubkey_credential_assertion_s *pubkey_cred =
(wauthn_pubkey_credential_assertion_s*) calloc(1, sizeof(wauthn_pubkey_credential_assertion_s));
- pubkey_cred->type = pct_public_key;
+ pubkey_cred->type = PCT_PUBLIC_KEY;
callbacks->response_callback(pubkey_cred, WAUTHN_ERROR_NONE, callbacks->user_data);
}
wauthn_user_entity_s userEntity = {const_cast<char*>(name), &bufferId, const_cast<char*>(displayName)};
wauthn_user_entity_s emptyUserEntity = {nullptr, nullptr, nullptr};
- wauthn_pubkey_cred_type_e pubkeyCredType = pct_public_key;
+ wauthn_pubkey_cred_type_e pubkeyCredType = PCT_PUBLIC_KEY;
wauthn_pubkey_cred_param_s credParam0 = {pubkeyCredType, WAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256};
wauthn_pubkey_cred_param_s credParam1 = {pubkeyCredType, WAUTHN_COSE_ALGORITHM_ECDSA_P521_WITH_SHA512};
wauthn_pubkey_cred_param_s pubkeyCredParam2[2] = {credParam0, credParam1};
authenticationExtArr2};
wauthn_authentication_exts_s emptyAuthenticationExts = {0, nullptr};
- wauthn_authenticator_attachment_e attachment = aa_platform;
- wauthn_resident_key_requirement_e resident_key = rkr_preferred;
+ wauthn_authenticator_attachment_e attachment = AA_PLATFORM;
+ wauthn_resident_key_requirement_e resident_key = RKR_PREFERRED;
bool require_resident_key = false;
- wauthn_user_verification_requirement_e user_verification = uvr_discouraged;
+ wauthn_user_verification_requirement_e user_verification = UVR_DISCOURAGED;
wauthn_authenticator_sel_cri_s authenticatorSelCri = {attachment, resident_key,
require_resident_key, user_verification};
- wauthn_pubkey_cred_hint_e hint0 = pch_security_key;
- wauthn_pubkey_cred_hint_e hint1 = pch_client_device;
+ wauthn_pubkey_cred_hint_e hint0 = PCH_SECURITY_KEY;
+ wauthn_pubkey_cred_hint_e hint1 = PCH_CLIENT_DEVICE;
wauthn_pubkey_cred_hint_e pubkeyCredHint1[1] = {hint0};
wauthn_pubkey_cred_hint_e pubkeyCredHint2[2] = {hint0, hint1};
wauthn_pubkey_cred_hints_s pubkeyCredHints1 = {sizeof(pubkeyCredHint1)/sizeof(pubkeyCredHint1[0]), pubkeyCredHint1};
unsigned char challengeRaw[06] = {0x01, 0x02, 0x03, 0x04, };
unsigned long timeout = 1000;
wauthn_buffer_s challenge = {challengeRaw, sizeof(challengeRaw)};
- wauthn_attestation_pref_e attestation = ap_direct;
+ wauthn_attestation_pref_e attestation = AP_DIRECT;
wauthn_pubkey_cred_creation_options_s pubkeyCredCreationOptions = {&rpEntity, &userEntity, &challenge,
&pubkeyCredParams2, timeout, &pubkeyCredDescriptors2, &authenticatorSelCri, &pubkeyCredHints2,
attestation, &attestationFormats1, &authenticationExts2, &hybirdLinkedData};
wauthn_pubkey_cred_creation_options_s emptyPubkeyCredCreationOptions = {nullptr, nullptr, nullptr,
- nullptr, 0, nullptr, nullptr, nullptr, ap_none, nullptr, nullptr, nullptr};
+ nullptr, 0, nullptr, nullptr, nullptr, AP_NONE, nullptr, nullptr, nullptr};
const char *rpId = "test RP ID";
wauthn_pubkey_cred_request_options_s pubkeyCredRequestOptions = {&challenge, timeout, const_cast<char *>(rpId),
&pubkeyCredDescriptors2, user_verification, &pubkeyCredHints2, attestation, &attestationFormats1,
&authenticationExts2, &hybirdLinkedData};
wauthn_pubkey_cred_request_options_s emptyPubkeyCredRequestOptions = {nullptr, 0, nullptr,
- nullptr, uvr_none, nullptr, ap_none, nullptr, nullptr, nullptr};
+ nullptr, UVR_NONE, nullptr, AP_NONE, nullptr, nullptr, nullptr};
bool is_conditional_mediation_available = false;
wauthn_pubkey_credential_attestaion_s pubkeyCredentialAttestation = {&bufferId, pubkeyCredType, &bufferId0,
}
TEST_F(WAuthnSerializationTest, wauthn_pubkey_cred_param_s_P)
{
- wauthn_pubkey_cred_param_s data1 = {pct_public_key, WAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256};
- wauthn_pubkey_cred_param_s data2 = {pct_public_key, WAUTHN_COSE_ALGORITHM_ECDSA_P521_WITH_SHA512};
+ wauthn_pubkey_cred_param_s data1 = {PCT_PUBLIC_KEY, WAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256};
+ wauthn_pubkey_cred_param_s data2 = {PCT_PUBLIC_KEY, WAUTHN_COSE_ALGORITHM_ECDSA_P521_WITH_SHA512};
__testSerialization(&data1, __compareWAuthnPubkeyCredParamS);
__testSerialization(&data2, __compareWAuthnPubkeyCredParamS);
wauthn_pubkey_cred_param_s data1 = {static_cast<wauthn_pubkey_cred_type_e>(0x00FFFFFF),
WAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256};
__testSerializeForInvalidMember(&data1);
- wauthn_pubkey_cred_param_s data2 = {pct_public_key,
+ wauthn_pubkey_cred_param_s data2 = {PCT_PUBLIC_KEY,
static_cast<wauthn_cose_algorithm_e>(0x00FFFFFF)};
__testSerializeForInvalidMember(&data2);
}
TEST_F(WAuthnSerializationTest, wauthn_authenticator_sel_cri_s_N3)
{// deserialize: for invalid attachment
wauthn_authenticator_sel_cri_s data = {static_cast<wauthn_authenticator_attachment_e>(0x00FFFFFF),
- rkr_discouraged,
+ RKR_DISCOURAGED,
false,
- uvr_discouraged};
+ UVR_DISCOURAGED};
__testDeserializeInvalidMember(data);
}
TEST_F(WAuthnSerializationTest, wauthn_authenticator_sel_cri_s_N4)
{// deserialize: for invalid resident_key
- wauthn_authenticator_sel_cri_s data = {aa_cross_platform,
+ wauthn_authenticator_sel_cri_s data = {AA_CROSS_PLATFORM,
static_cast<wauthn_resident_key_requirement_e>(0x00FFFFFF),
false,
- uvr_discouraged};
+ UVR_DISCOURAGED};
__testDeserializeInvalidMember(data);
}
TEST_F(WAuthnSerializationTest, wauthn_authenticator_sel_cri_s_N5)
{// deserialize: for invalid user_verification
- wauthn_authenticator_sel_cri_s data = {aa_cross_platform,
- rkr_discouraged,
+ wauthn_authenticator_sel_cri_s data = {AA_CROSS_PLATFORM,
+ RKR_DISCOURAGED,
false,
static_cast<wauthn_user_verification_requirement_e>(0x00FFFFFF)};
__testDeserializeInvalidMember(data);
wauthn_user_entity_s userEntity = {const_cast<char*>(name), &bufferId, const_cast<char*>(displayName)};
wauthn_user_entity_s emptyUserEntity = {nullptr, nullptr, nullptr};
- wauthn_pubkey_cred_type_e pubkeyCredType = pct_public_key;
+ wauthn_pubkey_cred_type_e pubkeyCredType = PCT_PUBLIC_KEY;
wauthn_pubkey_cred_param_s credParam0 = {pubkeyCredType, WAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256};
wauthn_pubkey_cred_param_s credParam1 = {pubkeyCredType, WAUTHN_COSE_ALGORITHM_ECDSA_P521_WITH_SHA512};
wauthn_pubkey_cred_param_s pubkeyCredParam2[2] = {credParam0, credParam1};
authenticationExtArr2};
wauthn_authentication_exts_s emptyAuthenticationExts = {0, nullptr};
- wauthn_authenticator_attachment_e attachment = aa_platform;
- wauthn_resident_key_requirement_e resident_key = rkr_preferred;
+ wauthn_authenticator_attachment_e attachment = AA_PLATFORM;
+ wauthn_resident_key_requirement_e resident_key = RKR_PREFERRED;
bool require_resident_key = false;
- wauthn_user_verification_requirement_e user_verification = uvr_discouraged;
+ wauthn_user_verification_requirement_e user_verification = UVR_DISCOURAGED;
wauthn_authenticator_sel_cri_s authenticatorSelCri = {attachment, resident_key,
require_resident_key, user_verification};
- wauthn_pubkey_cred_hint_e hint0 = pch_security_key;
- wauthn_pubkey_cred_hint_e hint1 = pch_client_device;
+ wauthn_pubkey_cred_hint_e hint0 = PCH_SECURITY_KEY;
+ wauthn_pubkey_cred_hint_e hint1 = PCH_CLIENT_DEVICE;
wauthn_pubkey_cred_hint_e pubkeyCredHint1[1] = {hint0};
wauthn_pubkey_cred_hint_e pubkeyCredHint2[2] = {hint0, hint1};
wauthn_pubkey_cred_hints_s pubkeyCredHints1 = {sizeof(pubkeyCredHint1)/sizeof(pubkeyCredHint1[0]), pubkeyCredHint1};
unsigned char challengeRaw[06] = {0x01, 0x02, 0x03, 0x04, };
unsigned long timeout = 1000;
wauthn_buffer_s challenge = {challengeRaw, sizeof(challengeRaw)};
- wauthn_attestation_pref_e attestation = ap_direct;
+ wauthn_attestation_pref_e attestation = AP_DIRECT;
wauthn_pubkey_cred_creation_options_s pubkeyCredCreationOptions = {&rpEntity, &userEntity, &challenge,
&pubkeyCredParams2, timeout, &pubkeyCredDescriptors2, &authenticatorSelCri, &pubkeyCredHints2,
attestation, &attestationFormats1, &authenticationExts2, &hybirdLinkedData};
wauthn_pubkey_cred_creation_options_s emptyPubkeyCredCreationOptions = {nullptr, nullptr, nullptr,
- nullptr, 0, nullptr, nullptr, nullptr, ap_none, nullptr, nullptr, nullptr};
+ nullptr, 0, nullptr, nullptr, nullptr, AP_NONE, nullptr, nullptr, nullptr};
const char *rpId = "test RP ID";
wauthn_pubkey_cred_request_options_s pubkeyCredRequestOptions = {&challenge, timeout, const_cast<char *>(rpId),
&pubkeyCredDescriptors2, user_verification, &pubkeyCredHints2, attestation, &attestationFormats1,
&authenticationExts2, &hybirdLinkedData};
wauthn_pubkey_cred_request_options_s emptyPubkeyCredRequestOptions = {nullptr, 0, nullptr,
- nullptr, uvr_none, nullptr, ap_none, nullptr, nullptr, nullptr};
+ nullptr, UVR_NONE, nullptr, AP_NONE, nullptr, nullptr, nullptr};
bool is_conditional_mediation_available = false;
wauthn_pubkey_credential_attestaion_s pubkeyCredentialAttestation = {&bufferId, pubkeyCredType, &bufferId0,