Mayank Gupta / Mbed OS pelion-example-frdm

Dependencies:   FXAS21002 FXOS8700Q

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers fcc_verification.h Source File

fcc_verification.h

00001 // ----------------------------------------------------------------------------
00002 // Copyright 2016-2017 ARM Ltd.
00003 //  
00004 // Licensed under the Apache License, Version 2.0 (the "License");
00005 // you may not use this file except in compliance with the License.
00006 // You may obtain a copy of the License at
00007 //  
00008 //     http://www.apache.org/licenses/LICENSE-2.0
00009 //  
00010 // Unless required by applicable law or agreed to in writing, software
00011 // distributed under the License is distributed on an "AS IS" BASIS,
00012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013 // See the License for the specific language governing permissions and
00014 // limitations under the License.
00015 // ----------------------------------------------------------------------------
00016 
00017 #ifndef __FCC_VERIFICATION_H__
00018 #define __FCC_VERIFICATION_H__
00019 
00020 #include <stdlib.h>
00021 #include <stdbool.h>
00022 #include <inttypes.h>
00023 #include "key_config_manager.h"
00024 #include "factory_configurator_client.h"
00025 #include "fcc_defs.h"
00026 #include "cs_utils.h"
00027 #include "cs_der_certs.h"
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 /**
00034 * The size of the binary representation of UUID5. Used in verifying firmware vendor and class IDs.
00035 */
00036 #define FCC_UUID5_SIZE_IN_BYTES 16
00037 
00038 /**
00039 * Types of configuration parameter
00040 */
00041 typedef enum {
00042     FCC_MANUFACTURER_NAME_CONFIG_PARAM_TYPE,
00043     FCC_MODEL_NUMBER_CONFIG_PARAM_TYPE,
00044     FCC_DEVICE_TYPE_CONFIG_PARAM_TYPE,
00045     FCC_HARDWARE_VERSION_CONFIG_PARAM_TYPE,
00046     FCC_MEMORY_TOTAL_SIZE_CONFIG_PARAM_TYPE,
00047     FCC_DEVICE_SERIAL_NUMBER_CONFIG_PARAM_TYPE,
00048     FCC_MAX_CONFIG_PARAM_TYPE
00049 } fcc_config_param_type_e;
00050 
00051 /**
00052 * Configuration parameters lookup record, correlating parameter's type and name
00053 */
00054 typedef struct fcc_config_param_lookup_record_ {
00055     fcc_config_param_type_e config_param_type;
00056     const char *config_param_name;
00057 } fcc_config_param_lookup_record_s;
00058 
00059 
00060 /** Checks entropy initialization
00061 *
00062 *    @returns
00063 *        entropy status  true/false.
00064 */
00065 bool fcc_is_entropy_initialized(void);
00066 
00067 /** Checks that all mandatory device meta data is present
00068 *
00069 *    @returns
00070 *        fcc_status_e status.
00071 */
00072 fcc_status_e  fcc_check_device_meta_data(void);
00073 
00074 /** Gets current bootstrap mode
00075 *
00076 * @param use_bootstrap[in/out]    The bootstrap mode
00077 *    @returns
00078 *        fcc_status_e status.
00079 */
00080 fcc_status_e  fcc_get_bootstrap_mode(bool *use_bootstrap);
00081 
00082 /**Function that checks all time synchronization parameters.
00083 *
00084 *    @returns
00085 *        fcc_status_e status.
00086 */
00087 fcc_status_e  fcc_check_time_synchronization(void);
00088 
00089 /** Checks mandatory device general info  - endpoint name. Does not check bootstrap_mode (checked with fcc_get_bootstrap_mode()).
00090 *
00091 *    @returns
00092 *        fcc_status_e status.
00093 */
00094 fcc_status_e  fcc_check_device_general_info( void );
00095 
00096 /** Checks device security objects : root ca certificate, device certificate, device private key and server URL.
00097 *
00098 * @param device_objects[in]           Structure with set of device security object names.
00099 * @param use_bootstrap[in]         Bootstrap mode.
00100 *    @returns
00101 *        fcc_status_e status.
00102 */
00103 fcc_status_e  fcc_check_device_security_objects(bool use_bootstrap);
00104 
00105 
00106 /** Checks firmware update integrity objects
00107 *
00108 *    @returns
00109 *        fcc_status_e status.
00110 */
00111 fcc_status_e   fcc_check_firmware_update_integrity( void );
00112 
00113 
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117 
00118 #endif //__FCC_VERIFICATION_H__