#include "third_party/abseil-cpp/absl/types/variant.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
#include "tizen_src/ewk/efl_integration/common/content_switches_efl.h"
+#include "tizen_src/platform/webauthn/webauthn_proxy.h"
namespace content {
RenderFrameHost* render_frame_host)
: render_frame_host_id_(render_frame_host->GetGlobalId()),
security_checker_(static_cast<RenderFrameHostImpl*>(render_frame_host)
- ->GetWebAuthRequestSecurityChecker()) {
+ ->GetWebAuthRequestSecurityChecker()),
+ webauthn_proxy_(platform::WebAuthnProxy::Get()) {
static_cast<RenderFrameHostImpl*>(GetRenderFrameHost())
->set_authenticator(weak_factory_.GetWeakPtr());
// Disable the back-forward cache for any document that makes WebAuthn
LOG(INFO) << "[Passkey] TO wauthn_make_credential, authenticator : " << this;
LOG(INFO) << "[Passkey] TO wauthn_make_credential with linked_device : "
<< ((mc_options_.linked_device) ? "yes" : "no");
- int ret = wauthn_make_credential(&client_data_, &mc_options_, &mc_callbacks_);
+ int ret = webauthn_proxy_->wauthn_make_credential(&client_data_, &mc_options_,
+ &mc_callbacks_);
if (ret != WAUTHN_ERROR_NONE) {
LOG(ERROR) << __FUNCTION__ << " call returned error status: "
<< WauthnErrorToString(static_cast<wauthn_error_e>(ret));
LOG(INFO) << "[Passkey] TO wauthn_get_assertion, authenticator : " << this;
LOG(INFO) << "[Passkey] TO wauthn_get_assertion with linked_device : "
<< ((mc_options_.linked_device) ? "yes" : "no");
- int ret = wauthn_get_assertion(&client_data_, &ga_options_, &ga_callbacks_);
+ int ret = webauthn_proxy_->wauthn_get_assertion(&client_data_, &ga_options_,
+ &ga_callbacks_);
if (ret != WAUTHN_ERROR_NONE) {
LOG(ERROR) << __FUNCTION__ << " call returned error status: "
<< WauthnErrorToString(static_cast<wauthn_error_e>(ret));
void AuthenticatorCommonTizen::Cancel() {
// Invoke Tizen WebAuthn cancel
- wauthn_cancel();
+ webauthn_proxy_->wauthn_cancel();
CancelWithStatus(blink::mojom::AuthenticatorStatus::ABORT_ERROR);
}
def process_function_declarations(source_code):
# Remove DEPRECATED_FUNCTION attribute
- source_code = re.sub(r'(\bTIZEN_DEPRECATED_API\b\s*;)', r';', source_code)
+ cleaned_line = []
+ #pattern = re.compile(r'(\))\s+[A-Z]+_DEPRECATED_[A-Z]+;')
+ for line in source_code.splitlines():
+ if "_DEPRECATED_" in line:
+ # print("Befpre remove DEPRECATED:", line)
+ words = line.split()
+ filtered_words = [word for word in words if "_DEPRECATED_" not in word]
+ new_line = ' '.join(filtered_words) + ";"
+ # print("After remove DEPRECATED:", new_line)
+ cleaned_line.append(new_line)
+ #new_line = pattern.sub(r'\1;',line)
+ #cleaned_line.append(new_line)
+ else:
+ cleaned_line.append(line)
- # Convert multi-line function declarations to single line
- source_code = re.sub(r'(\b\w+\s+\w+\s*$[^)]*,?\s*(?:\([^)]*$,\s*)*[^)]*\)\s*;)', r'\1', source_code)
+ buffer = ""
+ result = []
+ in_enum_or_typedef = False
+ for line in cleaned_line:
+ # print("Line for multi line to one:", line)
+ stripped = line.strip()
+ if not stripped:
+ continue
+
+ if stripped.lower().startswith(("typedef enum", "enum")):
+ in_enum_or_typedef = True
+ elif in_enum_or_typedef and stripped.endswith("}") or stripped.endswith(";") and "}" in stripped:
+ in_enum_or_typedef = False
+ result.append(stripped)
+ continue
+
+ if in_enum_or_typedef:
+ result.append(stripped)
+ continue;
+
+ if buffer:
+ buffer += " " + stripped
+ else:
+ buffer = stripped
- return source_code
+ if '(' in buffer and ');' in buffer:
+ result.append(buffer)
+ buffer = ""
+
+ if buffer:
+ result.append(buffer)
+
+ return '\n'.join(result)
def generate_ifndef_macro(class_name):
# Replace each uppercase letter with an underscore followed by the uppercase letter
includedir = None
libname = None
+ prefix = None
with open(pc_file, 'r') as f:
for line in f:
if line.startswith("includedir="):
includedir = line.split("=", 1)[1].strip()
+ elif line.startswith("prefix="):
+ prefix = line.split("=", 1)[1].strip()
elif line.startswith("Libs:"):
libs_line = line.strip()
# Extract libname from Libs: -L${libdir} -l{libname}
libname = "lib" + libname_match.group(1) + ".so"
for base_dir in base_dirs:
- file_path = f"{base_dir}/{libname}"
- if os.path.exists(file_path):
- if os.path.islink(file_path):
- target_path = os.readlink(file_path)
- libname = os.path.basename(target_path)
- break
+ file_path = f"{base_dir}/{libname}"
+ if os.path.exists(file_path):
+ if os.path.islink(file_path):
+ target_path = os.readlink(file_path)
+ libname = os.path.basename(target_path)
+ break
if not includedir:
raise ValueError(f"includedir not found in pkg-config file: {pc_file}")
if not libname:
raise ValueError(f"libname not found in pkg-config file: {pc_file}")
- return includedir, libname
+ includedir = includedir.replace("${prefix}", prefix)
-def snake_to_camel(snake_str):
- components = snake_str.split('_')
- return ''.join(x.title() for x in components)
+ return includedir, libname
def main():
if len(sys.argv) < 3:
# Extract necessary information from the JSON configuration
filename = os.path.basename(json_file).split('.')[0]
typedeffilename = filename.replace("_proxy", "_typedef_proxy")
- classname = snake_to_camel(filename)
+ classname = config.get("name")
package = config.get("package")
headers = config.get("headers", [])
functions = config.get("functions", [])