Source0: %{name}-%{version}.tar.gz
Source1001: hal-backend-security-certs.manifest
BuildRequires: cmake
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(openssl3)
BuildRequires: pkgconfig(hal-rootstrap)
-BuildRequires: openssl3
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
-# Disable hal-rootstrap-checker in order to use dlog and openssl3
-%define disable_hal_rootstrap_checker 1
-
%description
Security Certs (based on the OpenSSL) backend library
SET(_LIB_VERSION_ "${PROJECT_VERSION}")
SET(_LIB_SOVERSION_ "0")
-FIND_PROGRAM(OPENSSL_TOOL openssl REQUIRED)
FIND_PACKAGE(PkgConfig REQUIRED)
+PKG_CHECK_MODULES(ROOTSTRAP REQUIRED hal-rootstrap)
-ADD_EXECUTABLE(bin2c bin2c.c)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.key
- COMMAND ${OPENSSL_TOOL} genrsa -out ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.key 1024)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.key
- COMMAND ${OPENSSL_TOOL} genrsa -out ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.key 1024)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.pem
- COMMAND ${OPENSSL_TOOL} req -x509 -new -nodes -key ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.key
- -sha256 -days 1024 -out ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.pem
- -subj "/C=PL/ST=Test1/L=Test2/O=Test3/CN=Test4"
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.csr
- COMMAND ${OPENSSL_TOOL} req -new -sha256 -key ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.key
- -out ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.csr
- -subj "/C=PL/ST=Test10/L=Test20/O=Test30/CN=Test40"
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.pem
- COMMAND ${OPENSSL_TOOL} x509 -req -in ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.csr
- -CA ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.pem -CAkey ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.key -CAcreateserial
- -days 1024 -sha256 -out ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.pem
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.csr ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.pem ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chainRSA.pem
- COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.pem ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.pem > ${CMAKE_CURRENT_BINARY_DIR}/chainRSA.pem
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rootRSA.pem ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.pem)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.key
- COMMAND ${OPENSSL_TOOL} ecparam -name secp521r1 -genkey -noout -out ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.key
- COMMAND ${OPENSSL_TOOL} ecparam -name secp521r1 -genkey -noout -out ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.pem
- COMMAND ${OPENSSL_TOOL} req -x509 -new -nodes -key ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.key
- -sha256 -days 1024 -out ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.pem
- -subj "/C=PL/ST=Test1/L=Test2/O=Test3/CN=Test4"
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.csr
- COMMAND ${OPENSSL_TOOL} req -new -sha256 -key ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.key
- -out ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.csr
- -subj "/C=PL/ST=Test10/L=Test20/O=Test30/CN=Test40"
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.pem
- COMMAND ${OPENSSL_TOOL} x509 -req -in ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.csr
- -CA ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.pem -CAkey ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.key -CAcreateserial
- -days 1024 -sha256 -out ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.pem
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.csr ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.pem ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chainECDSA.pem
- COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.pem ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.pem > ${CMAKE_CURRENT_BINARY_DIR}/chainECDSA.pem
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rootECDSA.pem ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.pem)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/device_rsa_key.c
- COMMAND $<TARGET_FILE:bin2c> ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.key ${CMAKE_CURRENT_BINARY_DIR}/device_rsa_key.c device_rsa_key
- DEPENDS bin2c ${CMAKE_CURRENT_BINARY_DIR}/deviceRSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/device_rsa_cert.c
- COMMAND $<TARGET_FILE:bin2c> ${CMAKE_CURRENT_BINARY_DIR}/chainRSA.pem ${CMAKE_CURRENT_BINARY_DIR}/device_rsa_cert.c device_rsa_cert
- DEPENDS bin2c ${CMAKE_CURRENT_BINARY_DIR}/chainRSA.pem)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/device_ecdsa_key.c
- COMMAND $<TARGET_FILE:bin2c> ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.key ${CMAKE_CURRENT_BINARY_DIR}/device_ecdsa_key.c device_ecdsa_key
- DEPENDS bin2c ${CMAKE_CURRENT_BINARY_DIR}/deviceECDSA.key)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/device_ecdsa_cert.c
- COMMAND $<TARGET_FILE:bin2c> ${CMAKE_CURRENT_BINARY_DIR}/chainECDSA.pem ${CMAKE_CURRENT_BINARY_DIR}/device_ecdsa_cert.c device_ecdsa_cert
- DEPENDS bin2c ${CMAKE_CURRENT_BINARY_DIR}/chainECDSA.pem)
-
-PKG_CHECK_MODULES(SECURITY_CERTS_DEPS REQUIRED
- dlog
- hal-rootstrap
- openssl3)
-
-INCLUDE_DIRECTORIES(SYSTEM ${SECURITY_CERTS_DEPS_INCLUDE_DIRS})
-LINK_DIRECTORIES(${SECURITY_CERTS_DEPS_LIBRARY_DIRS})
-
-INCLUDE_DIRECTORIES(../shared)
+INCLUDE_DIRECTORIES(SYSTEM ${ROOTSTRAP_INCLUDE_DIRS})
+LINK_DIRECTORIES(${ROOTSTRAP_LIBRARY_DIRS})
ADD_LIBRARY(${PROJECT_NAME}
SHARED
hal_backend_security_certs_api.cpp
hal_backend_security_certs.cpp
- ../shared/log.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/device_ecdsa_key.c
- ${CMAKE_CURRENT_BINARY_DIR}/device_ecdsa_cert.c
- ${CMAKE_CURRENT_BINARY_DIR}/device_rsa_key.c
- ${CMAKE_CURRENT_BINARY_DIR}/device_rsa_cert.c)
+ log.cpp
+ device_ecdsa_key.c
+ device_ecdsa_cert.c
+ device_rsa_key.c
+ device_rsa_cert.c)
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SECURITY_CERTS_DEPS_LIBRARIES})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ROOTSTRAP_LIBRARIES} -lcrypto -lssl -ldlog -ldl)
SET_TARGET_PROPERTIES(${PROJECT_NAME}
PROPERTIES
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2018 Samsung Electronics 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.
- *
- ******************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, char** argv)
-{
- int ret = 0;
- size_t size;
- char *buffer = NULL;
-
- if(argc != 4)
- return -1;
-
- FILE *infile = fopen(argv[1], "rb");
- FILE *outfile = fopen(argv[2], "wb");
- if(!infile || !outfile) {
- perror("fopen() failed");
- ret = -1;
- goto exit;
- }
-
- if(fseek(infile, 0L, SEEK_END) < 0) {
- perror("fseek() failed");
- ret = -1;
- goto exit;
- }
- if((size = ftell(infile)) <= 0) {
- perror("ftell() failed");
- ret = -1;
- goto exit;
- }
- if(fseek(infile, 0L, SEEK_SET) < 0) {
- perror("fseek() failed");
- ret = -1;
- goto exit;
- }
-
- buffer = (char *)malloc(size);
- if(!buffer) {
- perror("malloc() failed");
- ret = -1;
- goto exit;
- }
-
- if(fread(buffer, 1, size, infile) <= 0) {
- perror("fread() failed");
- ret = -1;
- goto exit;
- }
-
- fprintf(outfile, "#include <sys/types.h>\nsize_t %s_size = %zd;\nunsigned char %s[]= {\n",
- argv[3], size, argv[3]);
-
- for(size_t i = 0 ; i < size ; ++i) {
- if(!(i % 64)) {
- fprintf(outfile, "\n");
- }
- fprintf(outfile, "0x%02X,", (unsigned char)buffer[i]);
- }
- fprintf(outfile, "0\n};\n");
-
-exit:
- if(infile) fclose(infile);
- if(outfile) fclose(outfile);
- free(buffer);
- return ret;
-}
--- /dev/null
+#include <sys/types.h>
+size_t device_ecdsa_cert_size = 1714;
+unsigned char device_ecdsa_cert[]= {
+
+0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49,0x49,0x43,0x49,0x54,0x43,0x43,0x41,0x59,0x49,0x43,0x46,0x43,0x4E,0x54,0x7A,0x69,0x62,0x37,0x6D,0x50,0x51,0x6F,0x45,0x70,0x54,0x4A,0x4F,0x72,0x5A,0x42,0x73,0x51,0x6B,0x41,
+0x39,0x30,0x36,0x35,0x4D,0x41,0x6F,0x47,0x43,0x43,0x71,0x47,0x53,0x4D,0x34,0x39,0x42,0x41,0x4D,0x43,0x4D,0x45,0x30,0x78,0x43,0x7A,0x41,0x4A,0x0A,0x42,0x67,0x4E,0x56,0x42,0x41,0x59,0x54,0x41,0x6C,0x42,0x4D,0x4D,0x51,0x34,0x77,0x44,0x41,0x59,0x44,0x56,0x51,0x51,0x49,0x44,0x41,0x56,0x55,0x5A,0x58,0x4E,0x30,0x4D,0x54,0x45,
+0x4F,0x4D,0x41,0x77,0x47,0x41,0x31,0x55,0x45,0x42,0x77,0x77,0x46,0x56,0x47,0x56,0x7A,0x64,0x44,0x49,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x0A,0x42,0x41,0x6F,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x7A,0x4D,0x51,0x34,0x77,0x44,0x41,0x59,0x44,0x56,0x51,0x51,0x44,0x44,0x41,0x56,0x55,0x5A,0x58,0x4E,0x30,0x4E,0x44,
+0x41,0x65,0x46,0x77,0x30,0x79,0x4E,0x54,0x41,0x79,0x4D,0x6A,0x59,0x77,0x4F,0x54,0x4D,0x35,0x4E,0x54,0x42,0x61,0x46,0x77,0x30,0x30,0x4E,0x54,0x41,0x79,0x0A,0x4D,0x6A,0x45,0x77,0x4F,0x54,0x4D,0x35,0x4E,0x54,0x42,0x61,0x4D,0x46,0x45,0x78,0x43,0x7A,0x41,0x4A,0x42,0x67,0x4E,0x56,0x42,0x41,0x59,0x54,0x41,0x6C,0x42,0x4D,0x4D,
+0x51,0x38,0x77,0x44,0x51,0x59,0x44,0x56,0x51,0x51,0x49,0x44,0x41,0x5A,0x55,0x5A,0x58,0x4E,0x30,0x4D,0x54,0x41,0x78,0x44,0x7A,0x41,0x4E,0x42,0x67,0x4E,0x56,0x0A,0x42,0x41,0x63,0x4D,0x42,0x6C,0x52,0x6C,0x63,0x33,0x51,0x79,0x4D,0x44,0x45,0x50,0x4D,0x41,0x30,0x47,0x41,0x31,0x55,0x45,0x43,0x67,0x77,0x47,0x56,0x47,0x56,0x7A,
+0x64,0x44,0x4D,0x77,0x4D,0x51,0x38,0x77,0x44,0x51,0x59,0x44,0x56,0x51,0x51,0x44,0x44,0x41,0x5A,0x55,0x5A,0x58,0x4E,0x30,0x4E,0x44,0x41,0x77,0x67,0x5A,0x73,0x77,0x0A,0x45,0x41,0x59,0x48,0x4B,0x6F,0x5A,0x49,0x7A,0x6A,0x30,0x43,0x41,0x51,0x59,0x46,0x4B,0x34,0x45,0x45,0x41,0x43,0x4D,0x44,0x67,0x59,0x59,0x41,0x42,0x41,0x44,
+0x45,0x46,0x4A,0x59,0x62,0x47,0x4A,0x61,0x79,0x70,0x56,0x6E,0x64,0x78,0x56,0x54,0x53,0x36,0x43,0x66,0x59,0x72,0x6B,0x77,0x71,0x6C,0x42,0x30,0x53,0x4A,0x45,0x79,0x59,0x0A,0x78,0x6F,0x35,0x53,0x53,0x62,0x54,0x4B,0x48,0x49,0x41,0x71,0x4C,0x50,0x49,0x61,0x76,0x35,0x66,0x38,0x41,0x4A,0x2B,0x4E,0x31,0x47,0x46,0x43,0x36,0x53,
+0x72,0x77,0x74,0x78,0x76,0x36,0x30,0x6F,0x46,0x51,0x5A,0x32,0x5A,0x52,0x5A,0x2B,0x6D,0x4C,0x66,0x4A,0x65,0x4D,0x54,0x67,0x44,0x69,0x48,0x4C,0x46,0x63,0x4D,0x51,0x46,0x6A,0x0A,0x66,0x43,0x37,0x37,0x68,0x64,0x4F,0x45,0x4C,0x78,0x51,0x63,0x78,0x63,0x4A,0x70,0x6B,0x66,0x79,0x55,0x30,0x67,0x76,0x6E,0x65,0x36,0x7A,0x6B,0x70,
+0x4B,0x6E,0x52,0x61,0x42,0x67,0x63,0x74,0x46,0x74,0x64,0x36,0x51,0x35,0x2B,0x6D,0x49,0x54,0x71,0x67,0x34,0x74,0x71,0x73,0x38,0x77,0x77,0x65,0x6D,0x49,0x62,0x6F,0x49,0x67,0x33,0x0A,0x63,0x70,0x64,0x45,0x62,0x73,0x6B,0x6B,0x36,0x32,0x38,0x61,0x72,0x7A,0x41,0x4B,0x42,0x67,0x67,0x71,0x68,0x6B,0x6A,0x4F,0x50,0x51,0x51,0x44,
+0x41,0x67,0x4F,0x42,0x6A,0x41,0x41,0x77,0x67,0x59,0x67,0x43,0x51,0x67,0x45,0x56,0x6D,0x76,0x51,0x2F,0x74,0x4B,0x6F,0x66,0x36,0x59,0x38,0x73,0x46,0x58,0x4C,0x37,0x53,0x30,0x57,0x6D,0x0A,0x66,0x4B,0x73,0x4A,0x42,0x57,0x30,0x68,0x56,0x76,0x57,0x70,0x44,0x50,0x66,0x54,0x39,0x56,0x4D,0x75,0x4E,0x47,0x69,0x30,0x59,0x6A,0x4F,
+0x68,0x43,0x73,0x46,0x54,0x34,0x4A,0x5A,0x56,0x70,0x44,0x4B,0x49,0x6E,0x54,0x6D,0x59,0x2B,0x79,0x7A,0x4E,0x61,0x7A,0x41,0x6D,0x71,0x59,0x53,0x71,0x6F,0x6C,0x6A,0x31,0x72,0x37,0x2B,0x50,0x0A,0x65,0x51,0x4A,0x43,0x41,0x64,0x46,0x76,0x37,0x58,0x6B,0x2F,0x6A,0x4C,0x6C,0x6C,0x6C,0x45,0x47,0x33,0x37,0x4D,0x49,0x54,0x4A,0x6F,
+0x56,0x30,0x54,0x38,0x48,0x62,0x79,0x44,0x68,0x58,0x42,0x77,0x5A,0x6D,0x53,0x35,0x37,0x77,0x4C,0x6D,0x59,0x2F,0x4D,0x70,0x69,0x42,0x5A,0x34,0x37,0x59,0x51,0x69,0x71,0x6F,0x55,0x68,0x79,0x34,0x0A,0x6B,0x67,0x6B,0x6D,0x67,0x51,0x2B,0x31,0x33,0x30,0x51,0x4C,0x52,0x47,0x34,0x6F,0x74,0x39,0x50,0x35,0x6B,0x30,0x42,0x75,0x36,
+0x30,0x6F,0x42,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49,0x49,0x43,0x64,0x7A,
+0x43,0x43,0x41,0x64,0x69,0x67,0x41,0x77,0x49,0x42,0x41,0x67,0x49,0x55,0x43,0x73,0x62,0x2B,0x58,0x4C,0x77,0x59,0x79,0x39,0x2F,0x47,0x4E,0x7A,0x65,0x38,0x75,0x49,0x6D,0x48,0x71,0x6F,0x2B,0x62,0x69,0x55,0x51,0x77,0x43,0x67,0x59,0x49,0x4B,0x6F,0x5A,0x49,0x7A,0x6A,0x30,0x45,0x41,0x77,0x49,0x77,0x0A,0x54,0x54,0x45,0x4C,0x4D,
+0x41,0x6B,0x47,0x41,0x31,0x55,0x45,0x42,0x68,0x4D,0x43,0x55,0x45,0x77,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x67,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x78,0x4D,0x51,0x34,0x77,0x44,0x41,0x59,0x44,0x56,0x51,0x51,0x48,0x44,0x41,0x56,0x55,0x5A,0x58,0x4E,0x30,0x4D,0x6A,0x45,0x4F,0x0A,0x4D,0x41,0x77,0x47,
+0x41,0x31,0x55,0x45,0x43,0x67,0x77,0x46,0x56,0x47,0x56,0x7A,0x64,0x44,0x4D,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x4D,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x30,0x4D,0x42,0x34,0x58,0x44,0x54,0x49,0x31,0x4D,0x44,0x49,0x79,0x4E,0x6A,0x41,0x35,0x4D,0x7A,0x6B,0x31,0x4D,0x46,0x6F,0x58,0x0A,0x44,0x54,0x51,
+0x31,0x4D,0x44,0x49,0x79,0x4D,0x54,0x41,0x35,0x4D,0x7A,0x6B,0x31,0x4D,0x46,0x6F,0x77,0x54,0x54,0x45,0x4C,0x4D,0x41,0x6B,0x47,0x41,0x31,0x55,0x45,0x42,0x68,0x4D,0x43,0x55,0x45,0x77,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x67,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x78,0x4D,0x51,0x34,0x77,0x0A,0x44,0x41,
+0x59,0x44,0x56,0x51,0x51,0x48,0x44,0x41,0x56,0x55,0x5A,0x58,0x4E,0x30,0x4D,0x6A,0x45,0x4F,0x4D,0x41,0x77,0x47,0x41,0x31,0x55,0x45,0x43,0x67,0x77,0x46,0x56,0x47,0x56,0x7A,0x64,0x44,0x4D,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x4D,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x30,0x4D,0x49,0x47,0x62,0x0A,0x4D,
+0x42,0x41,0x47,0x42,0x79,0x71,0x47,0x53,0x4D,0x34,0x39,0x41,0x67,0x45,0x47,0x42,0x53,0x75,0x42,0x42,0x41,0x41,0x6A,0x41,0x34,0x47,0x47,0x41,0x41,0x51,0x42,0x39,0x73,0x78,0x4D,0x69,0x38,0x32,0x4B,0x41,0x59,0x49,0x76,0x73,0x61,0x42,0x38,0x78,0x77,0x52,0x4C,0x30,0x6F,0x41,0x63,0x4D,0x4F,0x78,0x49,0x54,0x36,0x55,0x74,0x0A,
+0x52,0x50,0x75,0x7A,0x4D,0x6E,0x38,0x31,0x50,0x47,0x4B,0x44,0x33,0x46,0x69,0x58,0x64,0x7A,0x70,0x53,0x76,0x33,0x76,0x64,0x62,0x71,0x42,0x52,0x7A,0x59,0x56,0x56,0x62,0x69,0x68,0x5A,0x67,0x50,0x2F,0x72,0x4D,0x34,0x33,0x68,0x76,0x69,0x45,0x70,0x2B,0x48,0x72,0x39,0x75,0x56,0x77,0x41,0x2F,0x66,0x55,0x4B,0x4E,0x4B,0x4F,0x4D,
+0x0A,0x2F,0x51,0x48,0x56,0x31,0x4E,0x65,0x7A,0x61,0x53,0x35,0x48,0x4B,0x73,0x4A,0x4B,0x63,0x2B,0x69,0x68,0x36,0x49,0x77,0x62,0x78,0x68,0x69,0x4B,0x78,0x46,0x46,0x59,0x49,0x4A,0x75,0x75,0x31,0x4F,0x73,0x6F,0x67,0x50,0x47,0x52,0x36,0x49,0x6B,0x75,0x41,0x7A,0x65,0x49,0x56,0x50,0x58,0x48,0x2B,0x2F,0x72,0x2B,0x42,0x65,0x69,
+0x6D,0x0A,0x53,0x36,0x70,0x5A,0x50,0x61,0x41,0x4D,0x61,0x70,0x54,0x53,0x41,0x51,0x32,0x6A,0x55,0x7A,0x42,0x52,0x4D,0x42,0x30,0x47,0x41,0x31,0x55,0x64,0x44,0x67,0x51,0x57,0x42,0x42,0x52,0x2B,0x49,0x7A,0x57,0x65,0x43,0x58,0x62,0x59,0x62,0x32,0x58,0x73,0x58,0x36,0x54,0x75,0x47,0x62,0x54,0x65,0x6C,0x77,0x48,0x58,0x5A,0x6A,
+0x41,0x66,0x0A,0x42,0x67,0x4E,0x56,0x48,0x53,0x4D,0x45,0x47,0x44,0x41,0x57,0x67,0x42,0x52,0x2B,0x49,0x7A,0x57,0x65,0x43,0x58,0x62,0x59,0x62,0x32,0x58,0x73,0x58,0x36,0x54,0x75,0x47,0x62,0x54,0x65,0x6C,0x77,0x48,0x58,0x5A,0x6A,0x41,0x50,0x42,0x67,0x4E,0x56,0x48,0x52,0x4D,0x42,0x41,0x66,0x38,0x45,0x42,0x54,0x41,0x44,0x41,
+0x51,0x48,0x2F,0x0A,0x4D,0x41,0x6F,0x47,0x43,0x43,0x71,0x47,0x53,0x4D,0x34,0x39,0x42,0x41,0x4D,0x43,0x41,0x34,0x47,0x4D,0x41,0x44,0x43,0x42,0x69,0x41,0x4A,0x43,0x41,0x4F,0x57,0x31,0x4A,0x76,0x74,0x49,0x62,0x79,0x75,0x50,0x6D,0x52,0x73,0x37,0x54,0x32,0x50,0x2B,0x54,0x4D,0x41,0x57,0x63,0x5A,0x73,0x67,0x58,0x52,0x4A,0x62,
+0x4F,0x71,0x67,0x75,0x0A,0x34,0x36,0x38,0x66,0x61,0x47,0x74,0x41,0x44,0x79,0x53,0x34,0x71,0x4B,0x48,0x68,0x43,0x73,0x45,0x6D,0x66,0x67,0x4A,0x4D,0x4D,0x75,0x76,0x79,0x66,0x64,0x73,0x51,0x38,0x67,0x30,0x53,0x50,0x48,0x42,0x63,0x53,0x41,0x48,0x2B,0x32,0x53,0x71,0x55,0x4D,0x5A,0x2F,0x4E,0x41,0x6B,0x49,0x42,0x7A,0x6A,0x4D,
+0x36,0x2B,0x35,0x4D,0x57,0x0A,0x33,0x78,0x33,0x52,0x64,0x62,0x55,0x6E,0x7A,0x6D,0x64,0x2F,0x66,0x41,0x68,0x76,0x54,0x66,0x64,0x79,0x37,0x6E,0x4F,0x59,0x55,0x78,0x46,0x6C,0x49,0x41,0x4C,0x43,0x2B,0x77,0x45,0x6E,0x2B,0x32,0x32,0x38,0x46,0x67,0x6F,0x76,0x77,0x6D,0x30,0x76,0x43,0x34,0x48,0x4C,0x71,0x46,0x53,0x6D,0x36,0x31,
+0x51,0x2B,0x6F,0x33,0x66,0x65,0x0A,0x43,0x4A,0x63,0x47,0x69,0x5A,0x43,0x35,0x73,0x44,0x54,0x50,0x78,0x4D,0x6F,0x3D,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0
+};
--- /dev/null
+#include <sys/types.h>
+size_t device_ecdsa_key_size = 365;
+unsigned char device_ecdsa_key[]= {
+
+0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x45,0x43,0x20,0x50,0x52,0x49,0x56,0x41,0x54,0x45,0x20,0x4B,0x45,0x59,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49,0x48,0x63,0x41,0x67,0x45,0x42,0x42,0x45,0x49,0x41,0x63,0x56,0x59,0x57,0x31,0x54,0x58,0x61,0x31,0x57,0x2B,0x72,0x63,0x78,0x55,0x69,0x4A,0x32,0x4B,0x69,0x4C,
+0x30,0x51,0x49,0x54,0x47,0x37,0x2B,0x4D,0x31,0x55,0x68,0x75,0x76,0x52,0x46,0x4F,0x67,0x35,0x6D,0x2B,0x6D,0x33,0x54,0x32,0x45,0x67,0x43,0x48,0x32,0x78,0x32,0x0A,0x79,0x47,0x43,0x68,0x31,0x6A,0x4D,0x71,0x52,0x5A,0x74,0x36,0x71,0x2F,0x79,0x47,0x38,0x45,0x36,0x6C,0x43,0x4D,0x34,0x58,0x5A,0x6F,0x31,0x64,0x35,0x43,0x69,0x63,
+0x5A,0x62,0x69,0x67,0x42,0x77,0x59,0x46,0x4B,0x34,0x45,0x45,0x41,0x43,0x4F,0x68,0x67,0x59,0x6B,0x44,0x67,0x59,0x59,0x41,0x42,0x41,0x44,0x45,0x46,0x4A,0x59,0x62,0x0A,0x47,0x4A,0x61,0x79,0x70,0x56,0x6E,0x64,0x78,0x56,0x54,0x53,0x36,0x43,0x66,0x59,0x72,0x6B,0x77,0x71,0x6C,0x42,0x30,0x53,0x4A,0x45,0x79,0x59,0x78,0x6F,0x35,
+0x53,0x53,0x62,0x54,0x4B,0x48,0x49,0x41,0x71,0x4C,0x50,0x49,0x61,0x76,0x35,0x66,0x38,0x41,0x4A,0x2B,0x4E,0x31,0x47,0x46,0x43,0x36,0x53,0x72,0x77,0x74,0x78,0x76,0x36,0x0A,0x30,0x6F,0x46,0x51,0x5A,0x32,0x5A,0x52,0x5A,0x2B,0x6D,0x4C,0x66,0x4A,0x65,0x4D,0x54,0x67,0x44,0x69,0x48,0x4C,0x46,0x63,0x4D,0x51,0x46,0x6A,0x66,0x43,
+0x37,0x37,0x68,0x64,0x4F,0x45,0x4C,0x78,0x51,0x63,0x78,0x63,0x4A,0x70,0x6B,0x66,0x79,0x55,0x30,0x67,0x76,0x6E,0x65,0x36,0x7A,0x6B,0x70,0x4B,0x6E,0x52,0x61,0x42,0x67,0x63,0x0A,0x74,0x46,0x74,0x64,0x36,0x51,0x35,0x2B,0x6D,0x49,0x54,0x71,0x67,0x34,0x74,0x71,0x73,0x38,0x77,0x77,0x65,0x6D,0x49,0x62,0x6F,0x49,0x67,0x33,0x63,
+0x70,0x64,0x45,0x62,0x73,0x6B,0x6B,0x36,0x32,0x38,0x61,0x72,0x77,0x3D,0x3D,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x45,0x43,0x20,0x50,0x52,0x49,0x56,0x41,0x54,0x45,0x20,0x4B,0x45,0x59,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0
+};
--- /dev/null
+#include <sys/types.h>
+size_t device_rsa_cert_size = 1714;
+unsigned char device_rsa_cert[]= {
+
+0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49,0x49,0x43,0x49,0x44,0x43,0x43,0x41,0x59,0x6B,0x43,0x46,0x48,0x64,0x37,0x50,0x6C,0x61,0x5A,0x32,0x4E,0x66,0x76,0x61,0x4D,0x46,0x50,0x68,0x6E,0x4D,0x2B,0x4C,0x4F,0x39,0x65,
+0x31,0x74,0x51,0x6A,0x4D,0x41,0x30,0x47,0x43,0x53,0x71,0x47,0x53,0x49,0x62,0x33,0x44,0x51,0x45,0x42,0x43,0x77,0x55,0x41,0x4D,0x45,0x30,0x78,0x0A,0x43,0x7A,0x41,0x4A,0x42,0x67,0x4E,0x56,0x42,0x41,0x59,0x54,0x41,0x6C,0x42,0x4D,0x4D,0x51,0x34,0x77,0x44,0x41,0x59,0x44,0x56,0x51,0x51,0x49,0x44,0x41,0x56,0x55,0x5A,0x58,0x4E,
+0x30,0x4D,0x54,0x45,0x4F,0x4D,0x41,0x77,0x47,0x41,0x31,0x55,0x45,0x42,0x77,0x77,0x46,0x56,0x47,0x56,0x7A,0x64,0x44,0x49,0x78,0x44,0x6A,0x41,0x4D,0x0A,0x42,0x67,0x4E,0x56,0x42,0x41,0x6F,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x7A,0x4D,0x51,0x34,0x77,0x44,0x41,0x59,0x44,0x56,0x51,0x51,0x44,0x44,0x41,0x56,0x55,0x5A,0x58,
+0x4E,0x30,0x4E,0x44,0x41,0x65,0x46,0x77,0x30,0x79,0x4E,0x54,0x41,0x79,0x4D,0x6A,0x59,0x77,0x4F,0x54,0x4D,0x35,0x4E,0x54,0x42,0x61,0x46,0x77,0x30,0x30,0x0A,0x4E,0x54,0x41,0x79,0x4D,0x6A,0x45,0x77,0x4F,0x54,0x4D,0x35,0x4E,0x54,0x42,0x61,0x4D,0x46,0x45,0x78,0x43,0x7A,0x41,0x4A,0x42,0x67,0x4E,0x56,0x42,0x41,0x59,0x54,0x41,
+0x6C,0x42,0x4D,0x4D,0x51,0x38,0x77,0x44,0x51,0x59,0x44,0x56,0x51,0x51,0x49,0x44,0x41,0x5A,0x55,0x5A,0x58,0x4E,0x30,0x4D,0x54,0x41,0x78,0x44,0x7A,0x41,0x4E,0x0A,0x42,0x67,0x4E,0x56,0x42,0x41,0x63,0x4D,0x42,0x6C,0x52,0x6C,0x63,0x33,0x51,0x79,0x4D,0x44,0x45,0x50,0x4D,0x41,0x30,0x47,0x41,0x31,0x55,0x45,0x43,0x67,0x77,0x47,
+0x56,0x47,0x56,0x7A,0x64,0x44,0x4D,0x77,0x4D,0x51,0x38,0x77,0x44,0x51,0x59,0x44,0x56,0x51,0x51,0x44,0x44,0x41,0x5A,0x55,0x5A,0x58,0x4E,0x30,0x4E,0x44,0x41,0x77,0x0A,0x67,0x5A,0x38,0x77,0x44,0x51,0x59,0x4A,0x4B,0x6F,0x5A,0x49,0x68,0x76,0x63,0x4E,0x41,0x51,0x45,0x42,0x42,0x51,0x41,0x44,0x67,0x59,0x30,0x41,0x4D,0x49,0x47,
+0x4A,0x41,0x6F,0x47,0x42,0x41,0x4B,0x48,0x4A,0x6A,0x37,0x59,0x72,0x33,0x4A,0x52,0x7A,0x59,0x72,0x52,0x69,0x4F,0x6B,0x38,0x4C,0x75,0x4E,0x38,0x48,0x75,0x72,0x59,0x48,0x0A,0x59,0x64,0x71,0x61,0x71,0x5A,0x75,0x65,0x57,0x75,0x34,0x68,0x39,0x73,0x59,0x35,0x67,0x77,0x33,0x41,0x43,0x6B,0x46,0x44,0x31,0x58,0x75,0x4D,0x7A,0x4E,
+0x55,0x38,0x6E,0x37,0x74,0x38,0x74,0x53,0x50,0x52,0x47,0x53,0x5A,0x57,0x61,0x57,0x43,0x35,0x39,0x64,0x55,0x46,0x6B,0x71,0x2B,0x79,0x53,0x5A,0x6D,0x67,0x59,0x44,0x7A,0x48,0x0A,0x58,0x56,0x55,0x55,0x6F,0x70,0x35,0x37,0x4F,0x77,0x6D,0x79,0x48,0x34,0x53,0x6C,0x53,0x68,0x66,0x39,0x63,0x4E,0x32,0x6C,0x74,0x30,0x59,0x34,0x4C,
+0x36,0x53,0x72,0x46,0x75,0x44,0x31,0x68,0x79,0x6B,0x74,0x49,0x6C,0x49,0x6B,0x2B,0x68,0x56,0x44,0x59,0x54,0x67,0x55,0x62,0x43,0x47,0x4B,0x79,0x6C,0x4D,0x79,0x47,0x79,0x51,0x65,0x0A,0x73,0x49,0x5A,0x7A,0x37,0x4E,0x51,0x46,0x6B,0x53,0x47,0x68,0x72,0x56,0x79,0x74,0x41,0x67,0x4D,0x42,0x41,0x41,0x45,0x77,0x44,0x51,0x59,0x4A,
+0x4B,0x6F,0x5A,0x49,0x68,0x76,0x63,0x4E,0x41,0x51,0x45,0x4C,0x42,0x51,0x41,0x44,0x67,0x59,0x45,0x41,0x6D,0x55,0x77,0x66,0x6F,0x37,0x6D,0x56,0x7A,0x44,0x39,0x32,0x77,0x73,0x66,0x6D,0x0A,0x4E,0x45,0x59,0x68,0x4F,0x77,0x4D,0x67,0x5A,0x4C,0x64,0x4C,0x47,0x33,0x6B,0x62,0x2F,0x53,0x73,0x34,0x46,0x4D,0x57,0x33,0x67,0x70,0x78,
+0x50,0x54,0x4B,0x78,0x51,0x77,0x5A,0x5A,0x34,0x4C,0x59,0x30,0x78,0x64,0x61,0x50,0x55,0x37,0x71,0x73,0x57,0x42,0x41,0x6D,0x45,0x55,0x51,0x64,0x48,0x63,0x70,0x6E,0x59,0x73,0x54,0x44,0x32,0x0A,0x43,0x38,0x73,0x66,0x74,0x41,0x56,0x41,0x72,0x5A,0x41,0x2F,0x37,0x43,0x4D,0x63,0x38,0x75,0x7A,0x38,0x31,0x50,0x6E,0x52,0x79,0x41,
+0x32,0x4C,0x78,0x63,0x48,0x33,0x58,0x6C,0x38,0x76,0x5A,0x66,0x2B,0x65,0x69,0x4D,0x73,0x51,0x67,0x4A,0x5A,0x31,0x65,0x70,0x6A,0x74,0x32,0x6E,0x45,0x50,0x76,0x41,0x61,0x72,0x55,0x76,0x31,0x38,0x0A,0x78,0x62,0x57,0x58,0x6F,0x66,0x4D,0x78,0x32,0x32,0x77,0x37,0x46,0x4D,0x65,0x35,0x49,0x4A,0x4F,0x53,0x75,0x72,0x70,0x6E,0x48,
+0x69,0x51,0x3D,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49,0x49,0x43,0x64,0x6A,
+0x43,0x43,0x41,0x64,0x2B,0x67,0x41,0x77,0x49,0x42,0x41,0x67,0x49,0x55,0x55,0x4E,0x58,0x71,0x44,0x72,0x61,0x34,0x34,0x38,0x68,0x7A,0x71,0x32,0x36,0x2F,0x4E,0x36,0x67,0x41,0x53,0x55,0x69,0x35,0x52,0x32,0x67,0x77,0x44,0x51,0x59,0x4A,0x4B,0x6F,0x5A,0x49,0x68,0x76,0x63,0x4E,0x41,0x51,0x45,0x4C,0x0A,0x42,0x51,0x41,0x77,0x54,
+0x54,0x45,0x4C,0x4D,0x41,0x6B,0x47,0x41,0x31,0x55,0x45,0x42,0x68,0x4D,0x43,0x55,0x45,0x77,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x67,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x78,0x4D,0x51,0x34,0x77,0x44,0x41,0x59,0x44,0x56,0x51,0x51,0x48,0x44,0x41,0x56,0x55,0x5A,0x58,0x4E,0x30,0x0A,0x4D,0x6A,0x45,0x4F,
+0x4D,0x41,0x77,0x47,0x41,0x31,0x55,0x45,0x43,0x67,0x77,0x46,0x56,0x47,0x56,0x7A,0x64,0x44,0x4D,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x4D,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x30,0x4D,0x42,0x34,0x58,0x44,0x54,0x49,0x31,0x4D,0x44,0x49,0x79,0x4E,0x6A,0x41,0x35,0x4D,0x7A,0x6B,0x31,0x0A,0x4D,0x46,0x6F,
+0x58,0x44,0x54,0x51,0x31,0x4D,0x44,0x49,0x79,0x4D,0x54,0x41,0x35,0x4D,0x7A,0x6B,0x31,0x4D,0x46,0x6F,0x77,0x54,0x54,0x45,0x4C,0x4D,0x41,0x6B,0x47,0x41,0x31,0x55,0x45,0x42,0x68,0x4D,0x43,0x55,0x45,0x77,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x67,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x78,0x0A,0x4D,0x51,
+0x34,0x77,0x44,0x41,0x59,0x44,0x56,0x51,0x51,0x48,0x44,0x41,0x56,0x55,0x5A,0x58,0x4E,0x30,0x4D,0x6A,0x45,0x4F,0x4D,0x41,0x77,0x47,0x41,0x31,0x55,0x45,0x43,0x67,0x77,0x46,0x56,0x47,0x56,0x7A,0x64,0x44,0x4D,0x78,0x44,0x6A,0x41,0x4D,0x42,0x67,0x4E,0x56,0x42,0x41,0x4D,0x4D,0x42,0x56,0x52,0x6C,0x63,0x33,0x51,0x30,0x0A,0x4D,
+0x49,0x47,0x66,0x4D,0x41,0x30,0x47,0x43,0x53,0x71,0x47,0x53,0x49,0x62,0x33,0x44,0x51,0x45,0x42,0x41,0x51,0x55,0x41,0x41,0x34,0x47,0x4E,0x41,0x44,0x43,0x42,0x69,0x51,0x4B,0x42,0x67,0x51,0x44,0x55,0x55,0x31,0x55,0x4A,0x47,0x4A,0x47,0x37,0x45,0x70,0x78,0x48,0x50,0x42,0x37,0x6D,0x33,0x62,0x4E,0x59,0x66,0x6D,0x4E,0x41,0x0A,
+0x2B,0x69,0x56,0x6C,0x53,0x47,0x6E,0x75,0x4A,0x68,0x34,0x33,0x6C,0x74,0x78,0x72,0x56,0x50,0x55,0x34,0x57,0x55,0x54,0x47,0x5A,0x67,0x39,0x75,0x4D,0x4D,0x61,0x58,0x52,0x71,0x30,0x72,0x74,0x76,0x6D,0x6D,0x6E,0x50,0x45,0x58,0x66,0x33,0x6F,0x43,0x59,0x35,0x61,0x62,0x65,0x36,0x43,0x4A,0x48,0x48,0x70,0x69,0x59,0x7A,0x4B,0x6F,
+0x0A,0x66,0x33,0x6F,0x47,0x56,0x46,0x73,0x56,0x4A,0x39,0x31,0x63,0x34,0x59,0x71,0x48,0x52,0x55,0x4A,0x41,0x30,0x75,0x71,0x6A,0x6E,0x59,0x48,0x57,0x65,0x45,0x69,0x71,0x4C,0x76,0x43,0x75,0x56,0x32,0x6A,0x6B,0x41,0x67,0x68,0x76,0x76,0x52,0x48,0x4A,0x59,0x70,0x45,0x41,0x68,0x79,0x45,0x7A,0x53,0x58,0x58,0x32,0x6B,0x6A,0x75,
+0x69,0x0A,0x46,0x30,0x46,0x49,0x53,0x4A,0x66,0x58,0x2F,0x32,0x70,0x74,0x51,0x57,0x56,0x76,0x66,0x51,0x49,0x44,0x41,0x51,0x41,0x42,0x6F,0x31,0x4D,0x77,0x55,0x54,0x41,0x64,0x42,0x67,0x4E,0x56,0x48,0x51,0x34,0x45,0x46,0x67,0x51,0x55,0x6A,0x6A,0x4F,0x61,0x44,0x4E,0x47,0x52,0x72,0x4E,0x48,0x5A,0x56,0x70,0x70,0x46,0x31,0x42,
+0x45,0x49,0x0A,0x55,0x59,0x33,0x4F,0x58,0x44,0x67,0x77,0x48,0x77,0x59,0x44,0x56,0x52,0x30,0x6A,0x42,0x42,0x67,0x77,0x46,0x6F,0x41,0x55,0x6A,0x6A,0x4F,0x61,0x44,0x4E,0x47,0x52,0x72,0x4E,0x48,0x5A,0x56,0x70,0x70,0x46,0x31,0x42,0x45,0x49,0x55,0x59,0x33,0x4F,0x58,0x44,0x67,0x77,0x44,0x77,0x59,0x44,0x56,0x52,0x30,0x54,0x41,
+0x51,0x48,0x2F,0x0A,0x42,0x41,0x55,0x77,0x41,0x77,0x45,0x42,0x2F,0x7A,0x41,0x4E,0x42,0x67,0x6B,0x71,0x68,0x6B,0x69,0x47,0x39,0x77,0x30,0x42,0x41,0x51,0x73,0x46,0x41,0x41,0x4F,0x42,0x67,0x51,0x41,0x44,0x59,0x50,0x4C,0x6D,0x66,0x4F,0x50,0x4E,0x69,0x4A,0x45,0x44,0x4D,0x37,0x6A,0x69,0x6B,0x4A,0x55,0x50,0x6B,0x5A,0x72,0x38,
+0x56,0x4C,0x64,0x69,0x0A,0x41,0x49,0x69,0x50,0x6A,0x4C,0x66,0x74,0x57,0x33,0x76,0x30,0x31,0x59,0x39,0x39,0x58,0x52,0x37,0x67,0x71,0x6F,0x77,0x4F,0x4A,0x33,0x31,0x31,0x45,0x61,0x69,0x62,0x47,0x39,0x65,0x63,0x2F,0x50,0x59,0x73,0x72,0x36,0x47,0x46,0x51,0x72,0x72,0x72,0x69,0x6B,0x67,0x58,0x35,0x6D,0x31,0x45,0x4F,0x73,0x4F,
+0x72,0x77,0x50,0x58,0x4F,0x0A,0x33,0x65,0x76,0x68,0x78,0x67,0x34,0x5A,0x52,0x38,0x57,0x77,0x51,0x76,0x47,0x6F,0x2B,0x70,0x62,0x68,0x4C,0x36,0x4E,0x34,0x68,0x73,0x6F,0x30,0x45,0x37,0x39,0x5A,0x31,0x43,0x68,0x66,0x41,0x61,0x36,0x6D,0x72,0x70,0x47,0x65,0x6C,0x35,0x6E,0x72,0x34,0x32,0x2B,0x51,0x4D,0x77,0x74,0x6A,0x50,0x7A,
+0x50,0x31,0x61,0x37,0x36,0x69,0x0A,0x32,0x6C,0x51,0x43,0x6F,0x30,0x78,0x38,0x6B,0x34,0x51,0x4B,0x30,0x77,0x3D,0x3D,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x43,0x45,0x52,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x45,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0
+};
--- /dev/null
+#include <sys/types.h>
+size_t device_rsa_key_size = 912;
+unsigned char device_rsa_key[]= {
+
+0x2D,0x2D,0x2D,0x2D,0x2D,0x42,0x45,0x47,0x49,0x4E,0x20,0x50,0x52,0x49,0x56,0x41,0x54,0x45,0x20,0x4B,0x45,0x59,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0x4D,0x49,0x49,0x43,0x64,0x51,0x49,0x42,0x41,0x44,0x41,0x4E,0x42,0x67,0x6B,0x71,0x68,0x6B,0x69,0x47,0x39,0x77,0x30,0x42,0x41,0x51,0x45,0x46,0x41,0x41,0x53,0x43,0x41,0x6C,0x38,0x77,
+0x67,0x67,0x4A,0x62,0x41,0x67,0x45,0x41,0x41,0x6F,0x47,0x42,0x41,0x4B,0x48,0x4A,0x6A,0x37,0x59,0x72,0x33,0x4A,0x52,0x7A,0x59,0x72,0x52,0x69,0x0A,0x4F,0x6B,0x38,0x4C,0x75,0x4E,0x38,0x48,0x75,0x72,0x59,0x48,0x59,0x64,0x71,0x61,0x71,0x5A,0x75,0x65,0x57,0x75,0x34,0x68,0x39,0x73,0x59,0x35,0x67,0x77,0x33,0x41,0x43,0x6B,0x46,
+0x44,0x31,0x58,0x75,0x4D,0x7A,0x4E,0x55,0x38,0x6E,0x37,0x74,0x38,0x74,0x53,0x50,0x52,0x47,0x53,0x5A,0x57,0x61,0x57,0x43,0x35,0x39,0x64,0x55,0x46,0x0A,0x6B,0x71,0x2B,0x79,0x53,0x5A,0x6D,0x67,0x59,0x44,0x7A,0x48,0x58,0x56,0x55,0x55,0x6F,0x70,0x35,0x37,0x4F,0x77,0x6D,0x79,0x48,0x34,0x53,0x6C,0x53,0x68,0x66,0x39,0x63,0x4E,
+0x32,0x6C,0x74,0x30,0x59,0x34,0x4C,0x36,0x53,0x72,0x46,0x75,0x44,0x31,0x68,0x79,0x6B,0x74,0x49,0x6C,0x49,0x6B,0x2B,0x68,0x56,0x44,0x59,0x54,0x67,0x55,0x0A,0x62,0x43,0x47,0x4B,0x79,0x6C,0x4D,0x79,0x47,0x79,0x51,0x65,0x73,0x49,0x5A,0x7A,0x37,0x4E,0x51,0x46,0x6B,0x53,0x47,0x68,0x72,0x56,0x79,0x74,0x41,0x67,0x4D,0x42,0x41,
+0x41,0x45,0x43,0x67,0x59,0x42,0x63,0x38,0x52,0x37,0x33,0x42,0x31,0x47,0x4C,0x6B,0x70,0x48,0x45,0x6B,0x4A,0x31,0x77,0x70,0x59,0x70,0x4A,0x7A,0x66,0x58,0x72,0x0A,0x39,0x6D,0x65,0x33,0x6E,0x70,0x77,0x4C,0x41,0x7A,0x69,0x33,0x6A,0x70,0x6C,0x6D,0x6E,0x4D,0x6C,0x31,0x7A,0x37,0x6E,0x55,0x62,0x6E,0x53,0x6F,0x71,0x6D,0x56,0x4E,
+0x70,0x71,0x73,0x59,0x6D,0x50,0x61,0x79,0x6F,0x62,0x2B,0x78,0x37,0x33,0x68,0x51,0x45,0x65,0x52,0x77,0x77,0x4F,0x66,0x59,0x75,0x54,0x4A,0x66,0x2F,0x65,0x61,0x45,0x0A,0x5A,0x47,0x4E,0x37,0x50,0x45,0x68,0x55,0x46,0x56,0x77,0x6C,0x35,0x39,0x67,0x47,0x61,0x7A,0x74,0x4D,0x77,0x6F,0x6D,0x37,0x6A,0x47,0x68,0x53,0x43,0x52,0x69,
+0x2F,0x6B,0x69,0x49,0x49,0x6A,0x4D,0x68,0x54,0x55,0x38,0x61,0x58,0x48,0x79,0x6F,0x78,0x52,0x71,0x4D,0x55,0x66,0x7A,0x2B,0x38,0x78,0x4A,0x4A,0x50,0x42,0x65,0x30,0x74,0x0A,0x4B,0x6D,0x65,0x4C,0x69,0x76,0x4E,0x36,0x6C,0x32,0x67,0x55,0x66,0x63,0x33,0x7A,0x2F,0x51,0x4A,0x42,0x41,0x4E,0x50,0x67,0x44,0x59,0x61,0x61,0x4C,0x4E,
+0x49,0x54,0x70,0x41,0x65,0x34,0x77,0x61,0x71,0x6A,0x70,0x36,0x48,0x71,0x55,0x31,0x56,0x68,0x39,0x57,0x50,0x56,0x52,0x42,0x30,0x33,0x79,0x59,0x46,0x45,0x7A,0x79,0x79,0x79,0x0A,0x6B,0x75,0x6E,0x45,0x4D,0x6E,0x61,0x67,0x62,0x58,0x4B,0x37,0x75,0x65,0x46,0x71,0x4D,0x4C,0x4D,0x37,0x78,0x64,0x65,0x39,0x6C,0x52,0x77,0x4C,0x46,
+0x6C,0x56,0x57,0x45,0x57,0x32,0x5A,0x5A,0x2F,0x53,0x55,0x35,0x44,0x73,0x43,0x51,0x51,0x44,0x44,0x65,0x78,0x33,0x71,0x48,0x59,0x47,0x37,0x50,0x42,0x39,0x43,0x68,0x41,0x2B,0x69,0x0A,0x44,0x42,0x47,0x4A,0x36,0x66,0x4E,0x69,0x67,0x46,0x4D,0x6E,0x57,0x44,0x36,0x4C,0x61,0x6C,0x75,0x50,0x32,0x39,0x73,0x33,0x38,0x33,0x32,0x5A,
+0x6F,0x71,0x68,0x36,0x59,0x70,0x6E,0x53,0x6A,0x38,0x44,0x71,0x53,0x4B,0x4C,0x36,0x4A,0x57,0x6C,0x30,0x76,0x79,0x71,0x2B,0x33,0x4D,0x30,0x53,0x2B,0x5A,0x62,0x66,0x5A,0x6E,0x56,0x52,0x0A,0x37,0x37,0x77,0x33,0x41,0x6B,0x41,0x4E,0x58,0x77,0x35,0x37,0x65,0x43,0x39,0x72,0x38,0x71,0x46,0x66,0x65,0x32,0x46,0x39,0x69,0x32,0x61,
+0x41,0x36,0x58,0x44,0x6F,0x36,0x6F,0x32,0x36,0x42,0x7A,0x4F,0x4E,0x52,0x49,0x41,0x4C,0x45,0x48,0x53,0x69,0x74,0x59,0x4A,0x67,0x44,0x6D,0x6E,0x41,0x34,0x73,0x38,0x46,0x64,0x71,0x4E,0x38,0x0A,0x66,0x6C,0x38,0x6B,0x63,0x4A,0x6C,0x44,0x7A,0x45,0x73,0x6B,0x77,0x65,0x35,0x65,0x35,0x46,0x65,0x6C,0x4F,0x78,0x45,0x38,0x64,0x6B,
+0x6B,0x52,0x41,0x6B,0x41,0x55,0x63,0x42,0x62,0x63,0x6C,0x32,0x45,0x73,0x39,0x6B,0x67,0x2B,0x61,0x42,0x68,0x4B,0x56,0x51,0x43,0x77,0x62,0x71,0x6C,0x6E,0x72,0x77,0x73,0x43,0x6E,0x68,0x4E,0x4C,0x0A,0x2B,0x44,0x37,0x43,0x64,0x37,0x59,0x66,0x7A,0x33,0x46,0x65,0x55,0x73,0x64,0x53,0x70,0x47,0x52,0x34,0x77,0x31,0x62,0x6B,0x4A,
+0x39,0x77,0x43,0x55,0x30,0x38,0x48,0x53,0x63,0x56,0x71,0x56,0x79,0x4F,0x4A,0x7A,0x46,0x61,0x64,0x33,0x4E,0x52,0x2F,0x55,0x4A,0x56,0x5A,0x41,0x6B,0x42,0x47,0x34,0x4D,0x76,0x67,0x4F,0x32,0x70,0x5A,0x0A,0x49,0x78,0x36,0x38,0x4B,0x6F,0x54,0x4B,0x69,0x62,0x66,0x43,0x47,0x2B,0x58,0x44,0x73,0x64,0x48,0x78,0x5A,0x4D,0x39,0x4D,
+0x59,0x54,0x57,0x52,0x39,0x41,0x51,0x47,0x74,0x36,0x57,0x77,0x36,0x63,0x68,0x47,0x41,0x4F,0x72,0x77,0x73,0x4D,0x7A,0x4E,0x62,0x50,0x51,0x4D,0x55,0x46,0x6C,0x75,0x43,0x46,0x58,0x4E,0x61,0x74,0x65,0x64,0x0A,0x63,0x6E,0x65,0x68,0x57,0x74,0x46,0x52,0x33,0x65,0x48,0x4E,0x0A,0x2D,0x2D,0x2D,0x2D,0x2D,0x45,0x4E,0x44,0x20,0x50,
+0x52,0x49,0x56,0x41,0x54,0x45,0x20,0x4B,0x45,0x59,0x2D,0x2D,0x2D,0x2D,0x2D,0x0A,0
+};
--- /dev/null
+/******************************************************************
+ *
+ * Copyright 2020 Samsung Electronics 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.
+ *
+ ******************************************************************/
+
+#include <dlog.h>
+#include <syslog.h>
+
+#ifdef NDEBUG
+int __log_level = LOG_ERR;
+#else
+int __log_level = LOG_DEBUG;
+#endif
+
+#define SECURITY_CERTS_LOG_TAG "SECURITY_CERTS_BACKEND"
+
+void security_certs_print(int priority, char const *fmt, ...)
+{
+ log_priority dlog_prio;
+
+ switch (priority) {
+ case LOG_EMERG:
+ dlog_prio = DLOG_FATAL;
+ break;
+ case LOG_ERR:
+ dlog_prio = DLOG_ERROR;
+ break;
+ case LOG_WARNING:
+ dlog_prio = DLOG_WARN;
+ break;
+ case LOG_INFO:
+ dlog_prio = DLOG_INFO;
+ break;
+ case LOG_DEBUG:
+ dlog_prio = DLOG_DEBUG;
+ break;
+ default:
+ dlog_prio = DLOG_DEFAULT;
+ }
+
+ va_list ap;
+ va_start(ap, fmt);
+ (void) dlog_vprint(dlog_prio, SECURITY_CERTS_LOG_TAG, fmt, ap);
+ va_end(ap);
+}
--- /dev/null
+/******************************************************************
+ *
+ * Copyright 2020 Samsung Electronics 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.
+ *
+ ******************************************************************/
+#ifndef SHARED_LOG_H_
+#define SHARED_LOG_H_
+
+#include <stdlib.h>
+#include <syslog.h>
+#include <sstream>
+
+#define UNUSED __attribute__((unused))
+
+extern int __log_level;
+extern void security_certs_print(int priority, char const *fmt, ...);
+
+namespace {
+ template <typename ...Args>
+ void UNUSED __LOG_FUN(int level, const std::stringstream &format, Args&&... args) {
+ security_certs_print(level, format.str().c_str(), std::forward<Args>(args)...);
+ }
+
+ template <>
+ void UNUSED __LOG_FUN(int level, const std::stringstream &format) {
+ security_certs_print(level, "%s", format.str().c_str());
+ }
+
+ template <typename ...Args>
+ void UNUSED __LOG_FUN(int level, const char *format, Args&&... args) {
+ security_certs_print(level, format, std::forward<Args>(args)...);
+ }
+
+ template <>
+ void UNUSED __LOG_FUN(int level, const char *format) {
+ security_certs_print(level, "%s", format);
+ }
+
+} // namespace anonymous
+
+#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
+
+#define __LOG(LEVEL, FORMAT, ...) \
+ do { \
+ if (LEVEL <= __log_level) { \
+ std::stringstream __LOG_FORMAT; \
+ __LOG_FORMAT << __FILENAME__ << ": " << __func__ << "(" << __LINE__ << ") > " << FORMAT; \
+ __LOG_FUN(LEVEL, __LOG_FORMAT, ##__VA_ARGS__); \
+ } \
+ } while (0)
+
+#define LOGM(...) __LOG(LOG_EMERG, __VA_ARGS__) /* system is unusable */
+#define LOGE(...) __LOG(LOG_ERR, __VA_ARGS__) /* error conditions */
+#define LOGW(...) __LOG(LOG_WARNING, __VA_ARGS__) /* warning conditions */
+#define LOGI(...) __LOG(LOG_INFO, __VA_ARGS__) /* informational */
+#define LOGD(...) __LOG(LOG_DEBUG, __VA_ARGS__) /* debug-level messages */
+
+#endif /* SHARED_LOG_H_ */
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2020 Samsung Electronics 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.
- *
- ******************************************************************/
-
-#include <dlog.h>
-#include <syslog.h>
-
-#ifdef NDEBUG
-int __log_level = LOG_ERR;
-#else
-int __log_level = LOG_DEBUG;
-#endif
-
-#define SECURITY_CERTS_LOG_TAG "SECURITY_CERTS_BACKEND"
-
-void security_certs_print(int priority, char const *fmt, ...)
-{
- log_priority dlog_prio;
-
- switch (priority) {
- case LOG_EMERG:
- dlog_prio = DLOG_FATAL;
- break;
- case LOG_ERR:
- dlog_prio = DLOG_ERROR;
- break;
- case LOG_WARNING:
- dlog_prio = DLOG_WARN;
- break;
- case LOG_INFO:
- dlog_prio = DLOG_INFO;
- break;
- case LOG_DEBUG:
- dlog_prio = DLOG_DEBUG;
- break;
- default:
- dlog_prio = DLOG_DEFAULT;
- }
-
- va_list ap;
- va_start(ap, fmt);
- (void) vprint_system_log(dlog_prio, SECURITY_CERTS_LOG_TAG, fmt, ap);
- va_end(ap);
-}
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2020 Samsung Electronics 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.
- *
- ******************************************************************/
-#ifndef SHARED_LOG_H_
-#define SHARED_LOG_H_
-
-#include <stdlib.h>
-#include <syslog.h>
-#include <sstream>
-
-#define UNUSED __attribute__((unused))
-
-extern int __log_level;
-extern void security_certs_print(int priority, char const *fmt, ...);
-
-namespace {
- template <typename ...Args>
- void UNUSED __LOG_FUN(int level, const std::stringstream &format, Args&&... args) {
- security_certs_print(level, format.str().c_str(), std::forward<Args>(args)...);
- }
-
- template <>
- void UNUSED __LOG_FUN(int level, const std::stringstream &format) {
- security_certs_print(level, "%s", format.str().c_str());
- }
-
- template <typename ...Args>
- void UNUSED __LOG_FUN(int level, const char *format, Args&&... args) {
- security_certs_print(level, format, std::forward<Args>(args)...);
- }
-
- template <>
- void UNUSED __LOG_FUN(int level, const char *format) {
- security_certs_print(level, "%s", format);
- }
-
-} // namespace anonymous
-
-#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
-
-#define __LOG(LEVEL, FORMAT, ...) \
- do { \
- if (LEVEL <= __log_level) { \
- std::stringstream __LOG_FORMAT; \
- __LOG_FORMAT << __FILENAME__ << ": " << __func__ << "(" << __LINE__ << ") > " << FORMAT; \
- __LOG_FUN(LEVEL, __LOG_FORMAT, ##__VA_ARGS__); \
- } \
- } while (0)
-
-#define LOGM(...) __LOG(LOG_EMERG, __VA_ARGS__) /* system is unusable */
-#define LOGE(...) __LOG(LOG_ERR, __VA_ARGS__) /* error conditions */
-#define LOGW(...) __LOG(LOG_WARNING, __VA_ARGS__) /* warning conditions */
-#define LOGI(...) __LOG(LOG_INFO, __VA_ARGS__) /* informational */
-#define LOGD(...) __LOG(LOG_DEBUG, __VA_ARGS__) /* debug-level messages */
-
-#endif /* SHARED_LOG_H_ */