Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
pana.h
00001 /* 00002 * Copyright (c) 2013-2018, Arm Limited and affiliates. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef PANA_H_ 00019 #define PANA_H_ 00020 #include "Security/Common/sec_lib_definitions.h" 00021 #include "Security/PANA/pana_header.h" 00022 #include "net_pana_parameters_api.h" 00023 #ifdef PANA 00024 00025 #define ZIGBEE_VENDOR_ID 0x0000917c 00026 #define PANA_EAP_VENDOR_FLAG 0x8000 00027 00028 #define PANA_EAP_KEYWRAP_TYPE 0x0001 00029 #define PANA_EAP_KEYREQ_TYPE 0x0002 00030 00031 typedef void pana_socket_packet_handler_cb(buffer_t *buf); 00032 typedef void pana_state_machine_step(sec_suite_t *suite); 00033 typedef buffer_t *pana_eap_tls_up_cb(buffer_t *buf, sec_suite_t *tls_suite); 00034 00035 extern pana_lib_parameters_s *pana_parameters_get(void); 00036 extern pana_session_t *pana_session_allocate(void); 00037 void pana_session_base_init(pana_session_t *p_session); 00038 extern pana_heap_t *pana_heap_structure_allocate(void); 00039 extern void pana_session_state_init(pana_session_t *p_session); 00040 extern sec_suite_t *pana_client_init(auth_info_t *auth_ptr, uint8_t *session_address_ptr, pana_tls_setup_s *setup); 00041 00042 /** Pana Core functions */ 00043 void pana_down(buffer_t *buf, sec_suite_t *suite); 00044 00045 extern bool pana_socket_init(pana_socket_packet_handler_cb *socket_handler, pana_state_machine_step *state_machine_stepper, pana_eap_tls_up_cb *tls_handler_cb); 00046 extern void pana_session_init_by_session_ptr(sec_suite_t *suite, auth_info_t *auth_ptr); 00047 00048 extern void pana_eap_down(buffer_t *buf, sec_suite_t *suite); 00049 extern void eap_tls_payload_push(buffer_t *buf); 00050 extern void pana_eap_payload_down(buffer_t *buf, const uint8_t *nonce, sec_suite_t *suite); 00051 00052 extern void pana_key_calculation(sec_suite_t *suite); 00053 00054 extern void pana_free_dynamic_ram(sec_suite_t *suite); 00055 extern void pana_start_message_build(buffer_t *buf, sec_suite_t *suite); 00056 extern void pana_authentication_ready(uint8_t status, protocol_interface_info_entry_t *cur_interface); 00057 #ifdef PANA_SERVER_API 00058 extern void pana_key_update_delay_timer(void); 00059 #else 00060 #define pana_key_update_delay_timer() ((void)0) 00061 #endif 00062 00063 int8_t pana_ccm_data_crypt(uint8_t *ptr, uint16_t len, uint8_t operation_type, uint32_t message_seq, sec_suite_t *suite); 00064 00065 extern void pana_timeout_timer_set(sec_suite_t *suite, sec_state_machine_t cur_state); 00066 extern int pana_retry_check(uint8_t counter, sec_state_machine_t cur_state); 00067 00068 buffer_t *pana_relay_parse(buffer_t *buf); 00069 bool pana_auth_check(uint8_t *ptr, uint16_t length, uint8_t *authency, uint8_t *key); 00070 void pana_session_startms_parse(buffer_t *buf, pana_header_t *header, sec_suite_t *suite); 00071 buffer_t *pana_auth_message_handler(buffer_t *buf, pana_header_t *header, sec_suite_t *suite); 00072 buffer_t *pana_relay_avp_build(buffer_t *buf, sec_suite_t *suite); 00073 buffer_t *build_pana_base(buffer_t *buf, pana_header_t *header, sec_suite_t *suite); 00074 void pana_set_agend_address(buffer_t *buf, bool relay, sec_suite_t *suite); 00075 void pana_eap_tls_up(buffer_t *buf, sec_suite_t *suite); 00076 int8_t pana_socket_id_get(void); 00077 void pana_auth_hash_calc(uint8_t *data_ptr, uint16_t data_length, uint8_t *key); 00078 #endif 00079 00080 #endif /* PANA_H_ */
Generated on Tue Jul 12 2022 13:54:40 by
