/* ipwps_debug.c - IPWPS DEBUG-ONLY API implementation */ /* * Copyright (c) 2008 Wind River Systems, Inc. * * The right to copy, distribute, modify, or otherwise make use * of this software may be licensed only pursuant to the terms * of an applicable Wind River license agreement. * */ /* modification history -------------------- 01d,24mar09,hfc Add drv if support 01c,05mar09,mry Add priliminary enrollee support 01b,04mar09,dwb Adding Fake attribute support in test vector 01a,29Dec08,mry Created */ /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* The following APIs are to be used for debugging purposes ONLY. * They are not part of the officially supported wps APIs. * Behavior when these commands are invoked is not guaranteed to be valid * nor safe for normal operation. */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ #include "ipwps_config.h" /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #define IPCOM_USE_CLIB_PROTO #include #include #include #include #include #include #include #include #include #include #include #include #include "ipwps_debug.h" #include "ipwps_private_api.h" #include "ipwps_core.h" #include "ipwps_ui.h" #ifdef IPWPS_USE_WPS_PROTOCOL #include "ipwps_proto_adaptor.h" #include "ipwps_protocol.h" #include "ipwps_protocol_handler.h" #include "ipwps_config_adaptor.h" #endif #ifdef IPWPS_USE_WPS_DRV_IF #include "ipwps_drv_if.h" #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ #if 0 #define IPWSP_PROTOMSG_TEST_OTHER_ATTR #define IPWPS_USE_PROTOMSG_TEST_VECTORS #define IPWPS_WPS_TESTAPP_ACK_DONE #endif /* **************************************************************************** * 5 TYPES **************************************************************************** */ /* **************************************************************************** * 6 EXTERN PROTOTYPES **************************************************************************** */ extern IP_GLOBAL void ipwps_proto_crypto_randgen(Ip_u8 *buf, Ip_u16 nbytes); extern IP_GLOBAL Ip_err ipwps_credentials_add_set(Ipwps_ctx* ctx, Ip_u16 setid, Ipwps_credential_set *from_cred); /* **************************************************************************** * 7 LOCAL PROTOTYPES **************************************************************************** */ /* **************************************************************************** * 8 STATIC FUNCTIONS **************************************************************************** */ #ifdef IPWPS_ENABLE_WPS_TESTAPP #ifdef IPWPS_USE_WPS_PROTOCOL IP_STATIC Ip_err ipwps_testapp_ca_cb_handler(struct Ipwps_ctx_st* ctx, Ipwps_config_adaptor_event *event); IP_STATIC Ip_err ipwps_testapp_notify_EAPOL_START(struct Ipwps_ctx_st* ctx, Ip_u8* peer_eth_addr); IP_STATIC Ip_err ipwps_testapp_rcv_ID_RESP(Ipwps_ctx* ctx, char *identity); IP_STATIC Ip_err ipwps_testapp_rcv_START(Ipwps_ctx* ctx); IP_STATIC Ip_err ipwps_testapp_rcv_M1(Ipwps_ctx* ctx, Ipwps_protomsg_M1* m1); IP_STATIC Ip_err ipwps_testapp_send_M2(Ipwps_ctx* ctx, Ipwps_protomsg_M1* m1); IP_STATIC Ip_err ipwps_testapp_send_M2D(Ipwps_ctx* ctx, Ipwps_protomsg_M1* m1); IP_STATIC Ip_err ipwps_testapp_rcv_M2(Ipwps_ctx* ctx, Ipwps_protomsg_M2* m2); IP_STATIC Ip_err ipwps_testapp_rcv_M2D(Ipwps_ctx* ctx, Ipwps_protomsg_M2D* m2d); IP_STATIC Ip_err ipwps_testapp_rcv_M3(Ipwps_ctx* ctx, Ipwps_protomsg_M3* m3); IP_STATIC Ip_err ipwps_testapp_rcv_M4(Ipwps_ctx* ctx, Ipwps_protomsg_M4* m4); IP_STATIC Ip_err ipwps_testapp_rcv_M5(Ipwps_ctx* ctx, Ipwps_protomsg_M5* m5); IP_STATIC Ip_err ipwps_testapp_rcv_M6(Ipwps_ctx* ctx, Ipwps_protomsg_M6* m6); IP_STATIC Ip_err ipwps_testapp_rcv_M7(Ipwps_ctx* ctx, Ipwps_protomsg_M7* m7); IP_STATIC Ip_err ipwps_testapp_rcv_M8(Ipwps_ctx* ctx, Ipwps_protomsg_M8* m8); IP_STATIC Ip_err ipwps_testapp_rcv_ACK(Ipwps_ctx* ctx, Ipwps_protomsg_ACK* ack); IP_STATIC Ip_err ipwps_testapp_rcv_NACK(Ipwps_ctx* ctx, Ipwps_protomsg_NACK* nack); IP_STATIC Ip_err ipwps_testapp_rcv_DONE(Ipwps_ctx* ctx, Ipwps_protomsg_DONE* done); IP_STATIC Ip_err ipwps_testapp_notify_wps_finished(Ipwps_ctx* ctx); IP_STATIC Ip_err ipwps_testapp_notify_wps_timeout(Ipwps_ctx* ctx); #endif #ifdef IPWPS_USE_WPS_DRV_IF IP_STATIC Ip_err ipwps_testapp_rcv_probe_response_ies ( Ipwps_ctx* ctx, Ipwps_drv_data* drv_data, Ip_u8 no_of_drv_data, Ipwps_drv_event_type event_type ); IP_STATIC Ip_err ipwps_testapp_rcv_probe_request_ies ( Ipwps_ctx* ctx, Ipwps_drv_data* drv_data, Ip_u8 no_of_drv_data, Ipwps_drv_event_type event_type ); IP_STATIC Ip_err ipwps_testapp_rcv_assoc_notify ( Ipwps_ctx* ctx, Ipwps_drv_data* drv_data, Ip_u8 no_of_drv_data, Ipwps_drv_event_type event_type ); #endif #endif /* * **************************************************************************** * 9 DATA **************************************************************************** */ #ifdef IPWPS_ENABLE_WPS_TESTAPP #ifdef IPWPS_USE_WPS_PROTOCOL IP_GLOBAL Ip_bool ipwps_testapp_use_m2d = IP_FALSE; /* Just for testing */ IP_STATIC Ipwps_proto_ctx *ipwps_testapp_proto_ctx = IP_NULL; IP_STATIC Ipwps_proto_rcv_methods ipwps_testapp_rcv_methods = { ipwps_testapp_notify_EAPOL_START, ipwps_testapp_rcv_ID_RESP, ipwps_testapp_rcv_START, ipwps_testapp_rcv_M1, ipwps_testapp_rcv_M2, ipwps_testapp_rcv_M2D, ipwps_testapp_rcv_M3, ipwps_testapp_rcv_M4, ipwps_testapp_rcv_M5, ipwps_testapp_rcv_M6, ipwps_testapp_rcv_M7, ipwps_testapp_rcv_M8, ipwps_testapp_rcv_ACK, ipwps_testapp_rcv_NACK, ipwps_testapp_rcv_DONE, ipwps_testapp_notify_wps_finished, ipwps_testapp_notify_wps_timeout }; #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS /* test vectors (based on a captured PBC exchange) used to fake a WPS exchange */ #define IPWPS_DEBUG_M1_VECTOR_SIZE 426 #define IPWPS_DEBUG_FAKE_ATTRIBUTE_SIZE 2048 #define IPWSP_PROTOMSG_TEST_OTHER_ATTR_SIZE 14 #if !defined(IPWPS_DEBUG_FAKE_ATTRIBUTE) && defined(IPWSP_PROTOMSG_TEST_OTHER_ATTR) IP_STATIC Ip_u8 m1_test_vector[IPWPS_DEBUG_M1_VECTOR_SIZE+ IPWSP_PROTOMSG_TEST_OTHER_ATTR_SIZE] = { #elif defined(IPWSP_PROTOMSG_TEST_OTHER_ATTR) && defined(IPWPS_DEBUG_FAKE_ATTRIBUTE) IP_STATIC Ip_u8 m1_test_vector[IPWPS_DEBUG_M1_VECTOR_SIZE+ IPWPS_DEBUG_FAKE_ATTRIBUTE_SIZE+ IPWSP_PROTOMSG_TEST_OTHER_ATTR_SIZE] = { #elif defined(IPWPS_DEBUG_FAKE_ATTRIBUTE) && !defined(IPWSP_PROTOMSG_TEST_OTHER_ATTR) IP_STATIC Ip_u8 m1_test_vector[IPWPS_DEBUG_M1_VECTOR_SIZE+ IPWPS_DEBUG_FAKE_ATTRIBUTE_SIZE] = { #else IP_STATIC Ip_u8 m1_test_vector[IPWPS_DEBUG_M1_VECTOR_SIZE] = { #endif 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x04, 0x10, 0x47, 0x00, 0x10, 0x00, 0x8f, 0xbd, 0x60, 0xe4, 0xf5, 0xe4, 0xf5, 0xc4, 0xe8, 0xeb, 0x29, 0xc9, 0xbc, 0x5c, 0x2f, 0x10, 0x20, 0x00, 0x06, 0x00, 0x17, 0x9a, 0x44, 0x61, 0x38, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x32, 0x00, 0xc0, 0x70, 0x66, 0x75, 0xa3, 0x83, 0x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 0x40, 0x10, 0x04, 0x00, 0x02, 0x00, 0x27, 0x10, 0x10, 0x00, 0x02, 0x00, 0x0f, 0x10, 0x0d, 0x00, 0x01, 0x01, 0x10, 0x08, 0x00, 0x02, 0x00, 0x8c, 0x10, 0x44, 0x00, 0x01, 0x01, 0x10, 0x21, 0x00, 0x16, 0x41, 0x74, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x10, 0x23, 0x00, 0x12, 0x4a, 0x75, 0x6d, 0x70, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x45, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x65, 0x10, 0x24, 0x00, 0x05, 0x32, 0x33, 0x30, 0x35, 0x34, 0x10, 0x42, 0x00, 0x09, 0x34, 0x34, 0x32, 0x33, 0x2d, 0x38, 0x38, 0x37, 0x38, 0x10, 0x54, 0x00, 0x08, 0x00, 0x01, 0x00, 0x50, 0xf2, 0x04, 0x00, 0x01, 0x10, 0x11, 0x00, 0x19, 0x59, 0x4f, 0x57, 0x2d, 0x4d, 0x59, 0x41, 0x4b, 0x41, 0x4e, 0x2d, 0x44, 0x32, 0x20, 0x2d, 0x20, 0x4a, 0x75, 0x6d, 0x70, 0x73, 0x74, 0x61, 0x72, 0x74, 0x10, 0x3c, 0x00, 0x01, 0x03, 0x10, 0x02, 0x00, 0x02, 0x00, 0x00, 0x10, 0x12, 0x00, 0x02, 0x00, 0x04, 0x10, 0x09, 0x00, 0x02, 0x00, 0x00, 0x10, 0x2d, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00 #ifdef IPWPS_DEBUG_FAKE_ATTRIBUTE , 0x10, 0x06, 0x07, 0xfc, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x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ifdef IPWSP_PROTOMSG_TEST_OTHER_ATTR IP_STATIC Ip_u8 m2_test_vector[420] = { #else IP_STATIC Ip_u8 m2_test_vector[408] = { #endif 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x05, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc, 0x10, 0x48, 0x00, 0x10, 0xc7, 0xc4, 0x14, 0x93, 0x64, 0x74, 0x30, 0x84, 0xa6, 0xa5, 0xa4, 0x1f, 0x50, 0x29, 0xb1, 0xd1, 0x10, 0x32, 0x00, 0xc0, 0x24, 0xb0, 0x3c, 0xb9, 0x6f, 0xf0, 0xf7, 0x5d, 0xba, 0x8a, 0xa8, 0xcd, 0x47, 0xab, 0xfd, 0xa7, 0x5c, 0x98, 0xfd, 0xda, 0x8e, 0xf0, 0x3d, 0xc3, 0x5e, 0xe2, 0xa9, 0x21, 0xe9, 0x0b, 0x20, 0xdc, 0x29, 0x6f, 0x5f, 0x64, 0xbc, 0x53, 0x85, 0x41, 0x6f, 0x43, 0x3e, 0x4e, 0x38, 0xc3, 0x02, 0xba, 0xd5, 0xe3, 0xe2, 0x82, 0x02, 0x91, 0xa4, 0xbb, 0x74, 0x26, 0x6e, 0x00, 0xd7, 0x93, 0x55, 0xb6, 0xdc, 0x6a, 0xf1, 0x65, 0xef, 0xaa, 0xff, 0xb3, 0xab, 0xde, 0xd4, 0xe9, 0x74, 0x4e, 0x42, 0xbf, 0x00, 0xf5, 0x47, 0xc8, 0xc7, 0xa6, 0x47, 0x79, 0xcb, 0xc8, 0x91, 0x51, 0x12, 0xdd, 0x5c, 0xf7, 0x3b, 0xdc, 0x80, 0xcc, 0x00, 0xde, 0x67, 0x1e, 0x70, 0xa4, 0xe3, 0x6f, 0xf0, 0x79, 0xe9, 0x91, 0x82, 0x8b, 0xc5, 0xbb, 0xc7, 0xf0, 0x05, 0x98, 0x6c, 0x9a, 0xfe, 0x99, 0xfd, 0x9d, 0x31, 0x52, 0x42, 0xce, 0x74, 0x05, 0xac, 0xd9, 0x18, 0xe3, 0x6f, 0x46, 0x4b, 0x90, 0x3f, 0x02, 0x83, 0xce, 0x79, 0x30, 0xf4, 0xe9, 0xb1, 0x87, 0xb4, 0x1e, 0x39, 0xe8, 0x5d, 0xb6, 0xd3, 0x30, 0x2e, 0xb2, 0x1f, 0x9b, 0x45, 0x10, 0xf3, 0x51, 0xef, 0xfe, 0x32, 0x64, 0x6b, 0x9b, 0x6f, 0xff, 0x6d, 0xc0, 0xd8, 0xc3, 0xed, 0x28, 0x14, 0xe8, 0x9c, 0x67, 0x1d, 0x33, 0x9a, 0x8b, 0xbe, 0x80, 0x79, 0x85, 0x10, 0x04, 0x00, 0x02, 0x00, 0x3f, 0x10, 0x10, 0x00, 0x02, 0x00, 0x0f, 0x10, 0x0d, 0x00, 0x01, 0x03, 0x10, 0x08, 0x00, 0x02, 0x00, 0x8c, 0x10, 0x21, 0x00, 0x0e, 0x44, 0x2d, 0x4c, 0x69, 0x6e, 0x6b, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x10, 0x23, 0x00, 0x07, 0x44, 0x49, 0x52, 0x2d, 0x36, 0x32, 0x35, 0x10, 0x24, 0x00, 0x02, 0x43, 0x32, 0x10, 0x42, 0x00, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x54, 0x00, 0x08, 0x00, 0x06, 0x00, 0x50, 0xf2, 0x04, 0x00, 0x01, 0x10, 0x11, 0x00, 0x11, 0x57, 0x69, 0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x4e, 0x20, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x10, 0x3c, 0x00, 0x01, 0x01, 0x10, 0x02, 0x00, 0x02, 0x00, 0x01, 0x10, 0x09, 0x00, 0x02, 0x00, 0x00, 0x10, 0x12, 0x00, 0x02, 0x00, 0x04, 0x10, 0x2d, 0x00, 0x04, 0x80, 0x03, 0x06, 0x01, #ifdef IPWSP_PROTOMSG_TEST_OTHER_ATTR 0x10, 0x66, 0x00, 0x02, 0x00, 0x00, 0x10, 0x67, 0x00, 0x02, 0x01, 0x02, #endif 0x10, 0x05, 0x00, 0x08, 0x9e, 0x8c, 0xce, 0xe1, 0x96, 0xb3, 0xfe, 0xa0 }; IP_STATIC Ip_u8 m2d_test_vector[194] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x06, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc, 0x10, 0x48, 0x00, 0x10, 0xc7, 0xc4, 0x14, 0x93, 0x64, 0x74, 0x30, 0x84, 0xa6, 0xa5, 0xa4, 0x1f, 0x50, 0x29, 0xb1, 0xd1, 0x10, 0x04, 0x00, 0x02, 0x00, 0x3f, 0x10, 0x10, 0x00, 0x02, 0x00, 0x0f, 0x10, 0x0d, 0x00, 0x01, 0x03, 0x10, 0x08, 0x00, 0x02, 0x00, 0x8c, 0x10, 0x21, 0x00, 0x0e, 0x44, 0x2d, 0x4c, 0x69, 0x6e, 0x6b, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x10, 0x23, 0x00, 0x07, 0x44, 0x49, 0x52, 0x2d, 0x36, 0x32, 0x35, 0x10, 0x24, 0x00, 0x02, 0x43, 0x32, 0x10, 0x42, 0x00, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x54, 0x00, 0x08, 0x00, 0x06, 0x00, 0x50, 0xf2, 0x04, 0x00, 0x01, 0x10, 0x11, 0x00, 0x11, 0x57, 0x69, 0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x4e, 0x20, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x10, 0x3c, 0x00, 0x01, 0x01, 0x10, 0x02, 0x00, 0x02, 0x00, 0x01, 0x10, 0x09, 0x00, 0x02, 0x00, 0x00, 0x10, 0x2d, 0x00, 0x04, 0x80, 0x03, 0x06, 0x01 }; IP_STATIC Ip_u8 m3_test_vector[114] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x07, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc, 0x10, 0x14, 0x00, 0x20, 0xb2, 0x4d, 0xb7, 0x81, 0x55, 0x55, 0xe7, 0x55, 0x35, 0x60, 0x55, 0x98, 0x07, 0x97, 0x19, 0x1c, 0x06, 0xc3, 0x94, 0x29, 0x3f, 0x5a, 0x7f, 0x88, 0x47, 0xdc, 0x2b, 0xfd, 0xf5, 0x9b, 0x68, 0x81, 0x10, 0x15, 0x00, 0x20, 0xb2, 0x4d, 0xb7, 0x81, 0x55, 0x55, 0xe7, 0x55, 0x35, 0x60, 0x55, 0x98, 0x07, 0x97, 0x19, 0x1c, 0x06, 0xc3, 0x94, 0x29, 0x3f, 0x5a, 0x7f, 0x88, 0x47, 0xdc, 0x2b, 0xfd, 0xf5, 0x9b, 0x68, 0x81, 0x10, 0x05, 0x00, 0x08, 0xf9, 0x37, 0x33, 0x62, 0x7d, 0x93, 0x6d, 0x0f }; IP_STATIC Ip_u8 m4_test_vector[182] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x08, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x3d, 0x00, 0x20, 0xe4, 0xdc, 0xa2, 0xb4, 0x3d, 0x5a, 0xdf, 0x06, 0x84, 0x6e, 0xa4, 0xcf, 0x93, 0xe2, 0x55, 0x18, 0x80, 0x43, 0xb6, 0x60, 0xf1, 0xda, 0xef, 0xbe, 0xb9, 0xde, 0xb1, 0x74, 0xfe, 0x20, 0x94, 0x63, 0x10, 0x3e, 0x00, 0x20, 0x0c, 0x8d, 0xc4, 0xde, 0xbd, 0x29, 0xc0, 0x76, 0xe1, 0x20, 0xa5, 0x88, 0x13, 0x10, 0x71, 0x65, 0xa2, 0x53, 0x11, 0x20, 0x9f, 0x4d, 0xb2, 0xac, 0xc1, 0x9c, 0xba, 0x1b, 0xa7, 0x07, 0x8a, 0x4e, 0x10, 0x18, 0x00, 0x40, 0xca, 0x8c, 0xd4, 0x61, 0x94, 0x65, 0x21, 0xfb, 0xc3, 0x87, 0xc1, 0x59, 0x76, 0x38, 0x6a, 0x56, 0x45, 0x5b, 0xbf, 0x5a, 0x88, 0x24, 0x4f, 0xaf, 0x06, 0xd5, 0x0c, 0x4a, 0x67, 0xa6, 0xfa, 0xd0, 0xc2, 0xf8, 0x46, 0x9b, 0xf2, 0x57, 0x8c, 0x6e, 0x75, 0x8e, 0x60, 0x2b, 0x6a, 0x9e, 0xbd, 0x68, 0x48, 0xf3, 0xdc, 0x56, 0x9a, 0x12, 0x60, 0x72, 0x4b, 0x86, 0x60, 0x4e, 0x99, 0xfd, 0x2a, 0x83, 0x10, 0x05, 0x00, 0x08, 0x39, 0x2f, 0xb4, 0x36, 0x0b, 0x6c, 0x8c, 0x21 }; IP_STATIC Ip_u8 m5_test_vector[110] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x09, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc, 0x10, 0x18, 0x00, 0x40, 0xf0, 0xbc, 0xb2, 0xee, 0x50, 0x99, 0x63, 0x4b, 0x2d, 0x66, 0x0f, 0x40, 0x9b, 0x72, 0x25, 0x99, 0xf7, 0x69, 0x92, 0xe0, 0x54, 0xac, 0x66, 0x41, 0xf0, 0xe0, 0x39, 0xb3, 0xe6, 0x24, 0x6a, 0x35, 0x30, 0xfc, 0x80, 0xa7, 0x21, 0x1d, 0x09, 0x93, 0x52, 0x15, 0xed, 0x7d, 0xbe, 0x59, 0xb5, 0x51, 0x6f, 0xb1, 0x15, 0xd8, 0xf4, 0x04, 0x6c, 0x1e, 0x8d, 0xe9, 0xfd, 0xf7, 0x44, 0xee, 0xf5, 0xe5, 0x10, 0x05, 0x00, 0x08, 0x70, 0xc2, 0x19, 0x55, 0xd0, 0x1e, 0xac, 0x10 }; IP_STATIC Ip_u8 m6_test_vector[110] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x0a, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x18, 0x00, 0x40, 0x66, 0x99, 0x5b, 0x5d, 0xdd, 0x87, 0x49, 0x97, 0x84, 0x28, 0x5b, 0x76, 0x40, 0xc5, 0x3e, 0xb7, 0x0f, 0x71, 0xa8, 0xee, 0x1e, 0xe2, 0xed, 0xa2, 0xbe, 0x0e, 0x0b, 0xac, 0x24, 0x64, 0x85, 0x0d, 0x24, 0xf5, 0x34, 0xea, 0xa7, 0x67, 0xc8, 0x2a, 0xba, 0x0e, 0x4e, 0xcf, 0xd9, 0xcf, 0x10, 0x5f, 0xf2, 0x17, 0xe9, 0x71, 0x84, 0x0a, 0xa4, 0xa2, 0x1b, 0x90, 0xfb, 0xe1, 0x06, 0xa7, 0x21, 0xa6, 0x10, 0x05, 0x00, 0x08, 0x62, 0xb7, 0x28, 0xae, 0xc8, 0xe9, 0x36, 0xa1 }; IP_STATIC Ip_u8 m7_test_vector[110] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x0b, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc, 0x10, 0x18, 0x00, 0x40, 0xf0, 0xbc, 0xb2, 0xee, 0x50, 0x99, 0x63, 0x4b, 0x2d, 0x66, 0x0f, 0x40, 0x9b, 0x72, 0x25, 0x99, 0x8c, 0x82, 0xf6, 0x95, 0xcc, 0xe4, 0xe8, 0x0d, 0x60, 0xc0, 0x62, 0xb8, 0xc7, 0x4b, 0x2b, 0xd2, 0x72, 0x7f, 0xa3, 0x26, 0x65, 0x2b, 0x92, 0xf5, 0x74, 0xd1, 0xfe, 0x43, 0x2d, 0xf6, 0xaf, 0x18, 0x65, 0xa9, 0x9b, 0x01, 0x79, 0xf5, 0x6d, 0xdb, 0x35, 0x47, 0xc8, 0x27, 0x11, 0x14, 0xb7, 0xb3, 0x10, 0x05, 0x00, 0x08, 0x8e, 0x62, 0x8d, 0xca, 0x9c, 0x16, 0x23, 0xd1 }; IP_STATIC Ip_u8 m8_test_vector[206] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x0c, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x18, 0x00, 0xa0, 0xfa, 0xfe, 0x7d, 0x58, 0xa1, 0x0f, 0x0a, 0xf0, 0xfa, 0x60, 0xc5, 0xcc, 0xa7, 0x5e, 0x9a, 0x14, 0xcc, 0x19, 0x19, 0xe0, 0x3a, 0xcc, 0x13, 0x29, 0x11, 0xc3, 0x7a, 0xad, 0xe6, 0x5c, 0x86, 0x47, 0x64, 0xef, 0xbe, 0x2b, 0x90, 0xad, 0x9b, 0x2f, 0x80, 0x10, 0xe8, 0x78, 0xef, 0xa8, 0x65, 0x6b, 0x94, 0x83, 0x7a, 0x56, 0x7c, 0xe8, 0x5f, 0x7d, 0x59, 0x2e, 0x3a, 0xe3, 0xd0, 0x84, 0x20, 0x39, 0xac, 0xed, 0xd2, 0xa4, 0x04, 0x8c, 0x1a, 0x96, 0x3b, 0x31, 0xfe, 0x57, 0x09, 0x62, 0x8e, 0x5c, 0x7f, 0xc3, 0x47, 0xde, 0xd5, 0x37, 0x07, 0x7c, 0x43, 0x72, 0x74, 0x1e, 0x02, 0xec, 0x7d, 0x87, 0xa7, 0x0b, 0xb1, 0xad, 0x3e, 0xeb, 0x6e, 0x80, 0xef, 0x55, 0x34, 0xe6, 0x5c, 0x3f, 0xa6, 0x97, 0x45, 0x38, 0x34, 0xd9, 0xbd, 0x1e, 0xb0, 0x2d, 0x2d, 0x37, 0x18, 0xfb, 0xb7, 0xb3, 0xc9, 0xc7, 0xef, 0x81, 0xa0, 0x46, 0x64, 0x46, 0x0d, 0xe2, 0x15, 0x4a, 0x17, 0x6a, 0x95, 0x63, 0x3b, 0x80, 0x38, 0x94, 0x44, 0x76, 0x26, 0x41, 0xad, 0xf2, 0x17, 0xce, 0x10, 0x5f, 0x8c, 0xc8, 0xeb, 0x03, 0x10, 0x05, 0x00, 0x08, 0x85, 0xbb, 0x55, 0x5d, 0xfa, 0x51, 0x89, 0x81 }; IP_STATIC Ip_u8 ack_test_vector[50] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x0d, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc }; IP_STATIC Ip_u8 nack_test_vector[56] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x0e, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc, 0x10, 0x09, 0x00, 0x02, 0x00, 0x11 }; IP_STATIC Ip_u8 done_test_vector[50] = { 0x10, 0x4a, 0x00, 0x01, 0x10, 0x10, 0x22, 0x00, 0x01, 0x0f, 0x10, 0x1a, 0x00, 0x10, 0xec, 0xc0, 0xea, 0xef, 0x06, 0x42, 0x3a, 0xbb, 0xad, 0x6b, 0xa3, 0x14, 0x21, 0xd0, 0x74, 0xdf, 0x10, 0x39, 0x00, 0x10, 0x29, 0x9c, 0x0d, 0x20, 0x50, 0xc9, 0x8c, 0x9d, 0xf8, 0x58, 0x9a, 0xff, 0x9c, 0x0c, 0x86, 0xfc }; #endif #endif #ifdef IPWPS_USE_WPS_DRV_IF IP_STATIC Ipwps_drv_rcv_methods ipwps_testapp_drv_rcv_methods = { ipwps_testapp_rcv_probe_response_ies, ipwps_testapp_rcv_probe_request_ies, ipwps_testapp_rcv_assoc_notify }; #endif #endif /* **************************************************************************** * 10 GLOBAL FUNCTIONS **************************************************************************** */ /* *=========================================================================== * ipwps_dbg_send_event *=========================================================================== * Description: Send a Debug event to the IPWPS process * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_dbg_send_event(Ipwps_msg_type_wpsdebug event_type) { Ipwps_ipd_msg *request, *response; Ip_err rc = IPCOM_SUCCESS; request = ipcom_calloc(1, sizeof(Ipwps_ipd_msg)); response = ipcom_calloc(1, sizeof(Ipwps_ipd_msg)); if (!request || !response ) { rc = IPCOM_ERR_NO_MEMORY; goto done_dbg_send_event; } IPWPS_PREPARE_IPD_MSG(request, IPWPS_IPD_EVENT_WPSDEBUG, IPCOM_SUCCESS, event_type); rc = ipcom_ipd_datamsg(IPWPS_PROCESS_NAME,request,sizeof(Ipwps_ipd_msg),response,sizeof(Ipwps_ipd_msg)); if (rc != IPCOM_SUCCESS) goto done_dbg_send_event; rc = response->ipd_msg.msgerr; done_dbg_send_event: if (response) ipcom_free(response); if (request) ipcom_free(request); return rc; } /* *=========================================================================== * ipwps_dbg_wps_begin *=========================================================================== * Description: DEBUG API - Trigger a WPS Begin Event * Parameters: * Returns: * */ IP_GLOBAL Ip_err ipwps_dbg_wps_begin(void) { return ipwps_dbg_send_event(IPWPS_MSG_TYPE_WPSDEBUG_WPS_BEGIN); } /* *=========================================================================== * ipwps_dbg_ap_show *=========================================================================== * Description: * Parameters: * Returns: * */ IP_GLOBAL Ip_err ipwps_dbg_ap_show(void) { return ipwps_dbg_send_event(IPWPS_MSG_TYPE_WPSDEBUG_AP_SHOW); } /* *=========================================================================== * ipwps_dbg_enrollee_show *=========================================================================== * Description: * Parameters: * Returns: * */ IP_GLOBAL Ip_err ipwps_dbg_enrollee_show(void) { return ipwps_dbg_send_event(IPWPS_MSG_TYPE_WPSDEBUG_ENROLLEE_SHOW); } /* *=========================================================================== * ipwps_dbg_registrar_show *=========================================================================== * Description: * Parameters: * Returns: * */ IP_GLOBAL Ip_err ipwps_dbg_registrar_show(void) { return ipwps_dbg_send_event(IPWPS_MSG_TYPE_WPSDEBUG_REGISTRAR_SHOW); } /* *=========================================================================== * ipwps_dbg_timers_show *=========================================================================== * Description: * Parameters: * Returns: * */ IP_GLOBAL Ip_err ipwps_dbg_timers_show(void) { return ipwps_dbg_send_event(IPWPS_MSG_TYPE_WPSDEBUG_TIMERS_SHOW); } #ifdef IPWPS_ENABLE_WPS_TESTAPP /* *=========================================================================== * ipwps_testapp_init *=========================================================================== * Description: Initializes the debug wps application which sends and receives * some WPS test vectors. * Parameters: * Returns: * */ IP_GLOBAL Ip_err ipwps_testapp_init(Ipwps_ctx* ctx) { #ifdef IPWPS_USE_WPS_PROTOCOL #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS ip_assert(ctx); if (ctx->public.coop_info.wps_role) { IPCOM_LOG2(CRIT, "ipwps_testapp_init :: ERROR! WPS Role already set to %s (%d)", ipwps_api_wps_role_name(ctx->public.coop_info.wps_role), ctx->public.coop_info.wps_role); return IPCOM_ERR_FAILED; } ctx->public.coop_info.wps_role = IPWPS_ROLE_TESTAPP; if (!ipwps_testapp_proto_ctx) { ipwps_testapp_proto_ctx = ipwps_protocol_ctx_init(ctx); if (!ipwps_testapp_proto_ctx) { IPCOM_LOG0(ERR, "ipwps_testapp_init :: failed to init protocol context"); return IPCOM_ERR_FAILED; } } if (ipwps_config_adaptor_register_cb(ctx, ipwps_testapp_ca_cb_handler) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_init :: failed to register callback with config adaptor"); return IPCOM_ERR_FAILED; } ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_IDLE); #endif if (ipwps_proto_adaptor_set_methods(ctx, &ipwps_testapp_rcv_methods, ipwps_testapp_proto_ctx) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_init :: ipwps_proto_adaptor_set_methods() failed"); return IPCOM_ERR_FAILED; } ipwps_proto_adaptor_set_identity(ctx, "WFA-SimpleConfig-TestApp-1-0"); if (ipwps_proto_adaptor_wps_on(ctx) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_init :: ipwps_proto_adaptor_wps_on() failed"); return IPCOM_ERR_FAILED; } #endif #ifdef IPWPS_USE_WPS_DRV_IF if (ctx->public.wps_drv_module.enabled) { if (ipwps_drv_set_methods(ctx, &ipwps_testapp_drv_rcv_methods) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_init :: ipwps_drv_set_methods() failed"); return IPCOM_ERR_FAILED; } } #endif return IPCOM_SUCCESS; } /* *=========================================================================== * ipwps_testapp_shutdown *=========================================================================== * Description: Shuts down the debug wps application. * Parameters: * Returns: * */ IP_GLOBAL Ip_err ipwps_testapp_shutdown(Ipwps_ctx* ctx) { ip_assert(ctx); #ifdef IPWPS_USE_WPS_PROTOCOL ctx->public.coop_info.wps_role = IPWPS_ROLE_NONE; ipcom_memset(&ctx->public.enrollee_info, 0, sizeof(ctx->public.enrollee_info)); ipcom_memset(&ctx->public.registrar_info, 0, sizeof(ctx->public.registrar_info)); ipwps_proto_adaptor_set_identity(ctx, ""); ipwps_proto_adaptor_wps_off(ctx); if (ipwps_config_adaptor_deregister_cb(ctx, ipwps_testapp_ca_cb_handler) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_shutdown :: failed to deregister callback with config adaptor"); return IPCOM_ERR_FAILED; } if (ipwps_proto_adaptor_remove_methods(ctx, ipwps_testapp_proto_ctx) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_shutdown :: ipwps_proto_adaptor_remove_methods() failed"); } if (ipwps_testapp_proto_ctx) { if (ipwps_protocol_ctx_destroy(ctx, ipwps_testapp_proto_ctx) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_shutdown :: failed to destroy protocol context"); } ipwps_testapp_proto_ctx = IP_NULL; } ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_IDLE); #endif return IPCOM_SUCCESS; } #ifdef IPWPS_USE_WPS_PROTOCOL /* *=========================================================================== * ipwps_testapp_ca_cb_handler *=========================================================================== * Description: Handle the Config Adaptor callback * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_ca_cb_handler(Ipwps_ctx *ctx, Ipwps_config_adaptor_event *event) { Ip_err rc; Ipwps_dev_pwd_container dev_pwd; Ipwps_operation_status status; ip_assert(ctx); ip_assert(event); if (event->status != IPWPS_OPSTATUS_OK) { IPCOM_LOG2(DEBUG2, "ipwps_testapp_ca_cb_handler :: Received a config adaptor event %d with status %d", event->type, event->status); return IPCOM_ERR_FAILED; } if (event->type == IPWPS_CA_EVENT_PIN) { IPCOM_LOG0(DEBUG2, "ipwps_testapp_ca_cb_handler :: Received a PIN event"); status = ipwps_ca_get_device_password(ctx, &dev_pwd); if (status != IPWPS_OPSTATUS_OK) { IPCOM_LOG1(ERR, "ipwps_testapp_init :: failed to retrieve device password (status=%d)", status); return IPCOM_ERR_FAILED; } rc = ipwps_proto_set_device_password(ipwps_testapp_proto_ctx, dev_pwd.pwd, dev_pwd.len); if (rc!= IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_ca_cb_handler :: ipwps_proto_set_device_password() failed"); } } else if (event->type == IPWPS_CA_EVENT_PUSHBUTTON) { IPCOM_LOG0(DEBUG2, "ipwps_testapp_ca_cb_handler :: Received a PUSHBUTTON event"); rc = ipwps_proto_adaptor_wps_begin(ctx); if (rc!= IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_ca_cb_handler :: ipwps_proto_adaptor_wps_begin() failed"); } } else { IPCOM_LOG1(ERR, "ipwps_testapp_ca_cb_handler :: Unrecognized event type %d", event->type); rc = IPCOM_ERR_FAILED; } return rc; } /* *=========================================================================== * ipwps_testapp_notify_EAPOL_START *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_notify_EAPOL_START(struct Ipwps_ctx_st* ctx, Ip_u8* peer_eth_addr) { if (!peer_eth_addr) { IPCOM_LOG0(ERR, "ipwps_testapp_notify_EAPOL_START :: NULL peer_eth_addr"); return IPCOM_ERR_INVALID_ARG; } IPCOM_LOG6(DEBUG2, "ipwps_testapp_notify_EAPOL_START called :: peer_eth_addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x", peer_eth_addr[0], peer_eth_addr[1], peer_eth_addr[2], peer_eth_addr[3], peer_eth_addr[4], peer_eth_addr[5]); ip_assert(ctx); ipcom_memcpy(ctx->public.enrollee_info.mac_addr, peer_eth_addr, 6); ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_IN_PROGRESS); return IPCOM_SUCCESS; } /* *=========================================================================== * ipwps_testapp_rcv_ID_RESP *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_ID_RESP(Ipwps_ctx* ctx, char *identity) { Ip_err rc = IPCOM_ERR_FAILED; IPCOM_LOG1(DEBUG2, "ipwps_testapp_rcv_ID_RESP called :: identity = %s", (identity ? identity : "(null)")); ip_assert(ctx); rc = ipwps_proto_adaptor_send_START(ctx); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_START *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_START(Ipwps_ctx* ctx) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M1 *m1 = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_START called"); ip_assert(ctx); ipcom_memcpy(ctx->public.enrollee_info.mac_addr, ctx->public.if_mac_addr, 6); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS m1 = (Ipwps_protomsg_M1 *)ipwps_protocol_decode_message(m1_test_vector, sizeof(m1_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_START :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m1 = (Ipwps_protomsg_M1 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M1); #endif if (!m1) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_START :: Failed to decode m1_test_vector"); return IPCOM_ERR_FAILED; } #if defined(IPWPS_USE_PROTOMSG_TEST_VECTORS) && defined(IPWPS_DEBUG_FAKE_ATTRIBUTE) ipwps_dump_data("Fake tlv data", m1->fake.octet, m1->fake.len); #endif if (m1->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M1) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_START :: Failed to decode m1_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M1 (0x%.4x)", m1->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M1); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m1) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_M1(ctx, m1); ipcom_free(m1); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M1 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M1(Ipwps_ctx* ctx, Ipwps_protomsg_M1* m1) { #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M2 *m2 = IP_NULL; Ipwps_protomsg_M2D *m2d = IP_NULL; #else Ipwps_operation_status status; Ipwps_dev_pwd_container dev_pwd; #endif IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M1 called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS #if defined(IPWPS_DEBUG_FAKE_ATTRIBUTE) ipwps_dump_data("Fake tlv data", m1->fake.octet, m1->fake.len); #endif if (!ipwps_testapp_use_m2d) m2 = (Ipwps_protomsg_M2 *)ipwps_protocol_decode_message(m2_test_vector, sizeof(m2_test_vector)); else m2d = (Ipwps_protomsg_M2D *)ipwps_protocol_decode_message(m2d_test_vector, sizeof(m2d_test_vector)); if (!ipwps_testapp_use_m2d && !m2) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M1 :: Failed to decode m2_test_vector"); return IPCOM_ERR_FAILED; } if (!ipwps_testapp_use_m2d && (m2->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M2)) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M1 :: Failed to decode m2_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M2 (0x%.4x)", m2->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M2); return IPCOM_ERR_FAILED; } if (ipwps_testapp_use_m2d && !m2d) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M2 :: Failed to decode m2d_test_vector"); return IPCOM_ERR_FAILED; } if (ipwps_testapp_use_m2d && (m2d->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M2D)) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M2 :: Failed to decode m2d_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M2D (0x%.4x)", m2d->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M2D); return IPCOM_ERR_FAILED; } if (!ipwps_testapp_use_m2d) rc = ipwps_proto_adaptor_send_M2(ctx, m2); else rc = ipwps_proto_adaptor_send_M2D(ctx, m2d); if (m2) ipcom_free(m2); if (m2d) ipcom_free(m2d); return rc; #else status = ipwps_ca_get_device_password(ctx, &dev_pwd); if (status < 0) { IPCOM_LOG1(ERR, "ipwps_testapp_init :: failed to retrieve device password (status=%d)", status); return IPCOM_ERR_FAILED; } if (status == IPWPS_OPSTATUS_PENDING) { IPCOM_LOG0(WARNING, "ipwps_testapp_init :: PIN NOT SET. Please set the PIN then restart the registration proces."); return ipwps_testapp_send_M2D(ctx, m1); } if (ipwps_proto_set_device_password(ipwps_testapp_proto_ctx, dev_pwd.pwd, dev_pwd.len) != IPCOM_SUCCESS) { IPCOM_LOG0(ERR, "ipwps_testapp_init :: ipwps_proto_set_device_password() failed"); return IPCOM_ERR_FAILED; } return ipwps_testapp_send_M2(ctx, m1); #endif } /* *=========================================================================== * ipwps_testapp_send_M2 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_send_M2(Ipwps_ctx* ctx, Ipwps_protomsg_M1* m1) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M2 *m2 = IP_NULL; ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_send_M2 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m2 = (Ipwps_protomsg_M2 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M2); if (!m2) { IPCOM_LOG0(ERR, "ipwps_testapp_send_M2 :: Failed to alloc m2"); return IPCOM_ERR_FAILED; } rc = ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m2); if (rc == IPCOM_SUCCESS) { rc = ipwps_proto_adaptor_send_M2(ctx, m2); } if (m2) ipcom_free(m2); return rc; } /* *=========================================================================== * ipwps_testapp_send_M2D *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_send_M2D(Ipwps_ctx* ctx, Ipwps_protomsg_M1* m1) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M2D *m2d = IP_NULL; ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M1 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m2d = (Ipwps_protomsg_M2D *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M2D); if (!m2d) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M1 :: Failed to alloc m2d"); return IPCOM_ERR_FAILED; } rc = ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m2d); if (rc == IPCOM_SUCCESS) { rc = ipwps_proto_adaptor_send_M2D(ctx, m2d); } if (m2d) ipcom_free(m2d); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M2 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M2(Ipwps_ctx* ctx, Ipwps_protomsg_M2* m2) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M3 *m3 = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M2 called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS m3 = (Ipwps_protomsg_M3 *)ipwps_protocol_decode_message(m3_test_vector, sizeof(m3_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M2 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m3 = (Ipwps_protomsg_M3 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M3); #endif if (!m3) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M2 :: Failed to decode m3_test_vector"); return IPCOM_ERR_FAILED; } if (m3->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M3) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M2 :: Failed to decode m3_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M3 (0x%.4x)", m3->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M3); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m3) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_M3(ctx, m3); ipcom_free(m3); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M2D *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M2D(Ipwps_ctx* ctx, Ipwps_protomsg_M2D* m2d) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_NACK *nack = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M2D called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS nack = (Ipwps_protomsg_NACK *)ipwps_protocol_decode_message(nack_test_vector, sizeof(nack_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M2D :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } nack = (Ipwps_protomsg_NACK *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_NACK); #endif if (!nack) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M2D :: Failed to decode nack_test_vector"); return IPCOM_ERR_FAILED; } if (nack->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_NACK) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M2D :: Failed to decode nack_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_NACK (0x%.4x)", nack->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_NACK); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)nack) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_NACK(ctx, nack); ipcom_free(nack); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M3 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M3(Ipwps_ctx* ctx, Ipwps_protomsg_M3* m3) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M4 *m4 = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M3 called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS m4 = (Ipwps_protomsg_M4 *)ipwps_protocol_decode_message(m4_test_vector, sizeof(m4_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M3 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m4 = (Ipwps_protomsg_M4 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M4); #endif if (!m4) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M3 :: Failed to decode m4_test_vector"); return IPCOM_ERR_FAILED; } if (m4->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M4) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M3 :: Failed to decode m4_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M4 (0x%.4x)", m4->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M4); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m4) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_M4(ctx, m4); ipcom_free(m4); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M4 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M4(Ipwps_ctx* ctx, Ipwps_protomsg_M4* m4) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M5 *m5 = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M4 called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS m5 = (Ipwps_protomsg_M5 *)ipwps_protocol_decode_message(m5_test_vector, sizeof(m5_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M4 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m5 = (Ipwps_protomsg_M5 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M5); #endif if (!m5) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M4 :: Failed to decode m5_test_vector"); return IPCOM_ERR_FAILED; } if (m5->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M5) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M4 :: Failed to decode m5_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M5 (0x%.4x)", m5->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M5); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m5) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_M5(ctx, m5); ipcom_free(m5); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M5 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M5(Ipwps_ctx* ctx, Ipwps_protomsg_M5* m5) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M6 *m6 = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M5 called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS m6 = (Ipwps_protomsg_M6 *)ipwps_protocol_decode_message(m6_test_vector, sizeof(m6_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M5 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m6 = (Ipwps_protomsg_M6 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M6); #endif if (!m6) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M5 :: Failed to decode m6_test_vector"); return IPCOM_ERR_FAILED; } if (m6->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M6) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M5 :: Failed to decode m6_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M6 (0x%.4x)", m6->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M6); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m6) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_M6(ctx, m6); ipcom_free(m6); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M6 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M6(Ipwps_ctx* ctx, Ipwps_protomsg_M6* m6) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M7 *m7 = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M6 called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS m7 = (Ipwps_protomsg_M7 *)ipwps_protocol_decode_message(m7_test_vector, sizeof(m7_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M6 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m7 = (Ipwps_protomsg_M7 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M7); #endif if (!m7) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M6 :: Failed to decode m7_test_vector"); return IPCOM_ERR_FAILED; } if (m7->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M7) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M6 :: Failed to decode m7_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M7 (0x%.4x)", m7->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M7); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m7) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_M7(ctx, m7); ipcom_free(m7); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M7 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M7(Ipwps_ctx* ctx, Ipwps_protomsg_M7* m7) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_M8 *m8 = IP_NULL; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M7 called"); ip_assert(ctx); #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS m8 = (Ipwps_protomsg_M8 *)ipwps_protocol_decode_message(m8_test_vector, sizeof(m8_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M7 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } m8 = (Ipwps_protomsg_M8 *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_M8); #endif if (!m8) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M7 :: Failed to decode m8_test_vector"); return IPCOM_ERR_FAILED; } if (m8->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_M8) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M7 :: Failed to decode m8_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_M8 (0x%.4x)", m8->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_M8); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)m8) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_M8(ctx, m8); ipcom_free(m8); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_M8 *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_M8(Ipwps_ctx* ctx, Ipwps_protomsg_M8* m8) { Ip_err rc = IPCOM_ERR_FAILED; Ipwps_protomsg_DONE *done = IP_NULL; Ipwps_credential_set *ecred; int i; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_M8 called"); ip_assert(ctx); /* Set the retrieved enrollee credentials */ ctx->credentials.num_enrollee_creds = m8->decr_set.num_wlan_creds; for (i = 0; i < m8->decr_set.num_wlan_creds; i++) { ecred = &ctx->credentials.enrollee_credentials[i]; ipcom_strncpy(ecred->ssid, (char *)m8->decr_set.wlan_credentials[i].ssid.name, IPWPS_SSID_MAXLEN+1); ecred->ssid[IPWPS_SSID_MAXLEN] = '\0'; ecred->auth_type = m8->decr_set.wlan_credentials[i].auth_type.val; ecred->encr_type = m8->decr_set.wlan_credentials[i].encr_type.val; ipcom_memcpy(ecred->mac_addr, m8->decr_set.wlan_credentials[i].mac_addr.octet, 6); if (m8->decr_set.wlan_credentials[i].network_idx.len) ecred->network_idx = m8->decr_set.wlan_credentials[i].network_idx.val; else ecred->network_idx = 1; /* defaults to 1 */ if (m8->decr_set.wlan_credentials[i].netkey_idx.len) ecred->netkey_idx = m8->decr_set.wlan_credentials[i].netkey_idx.val; else ecred->netkey_idx = 1; /* defaults to 1 */ ecred->netkey_size = m8->decr_set.wlan_credentials[i].netkey.len; ipcom_memcpy(ecred->netkey, m8->decr_set.wlan_credentials[i].netkey.octet, ecred->netkey_size); ecred->enabled_8021x = m8->decr_set.wlan_credentials[i].enabled_8021x.val; if (ecred->enabled_8021x) { ipcom_memcpy(ecred->eap_type, m8->decr_set.wlan_credentials[i].eap_type.octet, 8); ipcom_strncpy(ecred->eap_id, (char *)m8->decr_set.wlan_credentials[i].eap_id.name, IPWPS_MAX_EAP_ID_LEN+1); ecred->eap_id[IPWPS_MAX_EAP_ID_LEN] = '\0'; } ecred->valid = IP_TRUE; } #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS done = (Ipwps_protomsg_DONE *)ipwps_protocol_decode_message(done_test_vector, sizeof(done_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M8 :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } done = (Ipwps_protomsg_DONE *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_DONE); #endif if (!done) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_M8 :: Failed to decode done_test_vector"); return IPCOM_ERR_FAILED; } if (done->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_DONE) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_M8 :: Failed to decode done_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_DONE (0x%.4x)", done->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_DONE); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)done) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_DONE(ctx, done); ipcom_free(done); return rc; } /* *=========================================================================== * ipwps_testapp_rcv_DONE *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_DONE(Ipwps_ctx* ctx, Ipwps_protomsg_DONE* done) { Ip_err rc = IPCOM_ERR_FAILED; #if defined (IPWPS_WPS_TESTAPP_ACK_DONE) Ipwps_protomsg_ACK *ack = IP_NULL; #endif IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_DONE called"); ip_assert(ctx); #if defined (IPWPS_WPS_TESTAPP_ACK_DONE) /* Send a WSC ACK */ #ifdef IPWPS_USE_PROTOMSG_TEST_VECTORS ack = (Ipwps_protomsg_ACK *)ipwps_protocol_decode_message(ack_test_vector, sizeof(ack_test_vector)); #else ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_DONE :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } ack = (Ipwps_protomsg_ACK *)ipwps_proto_alloc_msg_struct(IPWPS_PROTO_MSGTYPE_ACK); #endif if (!ack) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_DONE :: Failed to decode ack_test_vector"); return IPCOM_ERR_FAILED; } if (ack->common_hdr.msg_type.val != IPWPS_PROTO_MSGTYPE_ACK) { IPCOM_LOG2(ERR, "ipwps_testapp_rcv_DONE :: Failed to decode ack_test_vector msg_type.val " "(0x%.4x) != IPWPS_PROTO_MSGTYPE_ACK (0x%.4x)", ack->common_hdr.msg_type.val, IPWPS_PROTO_MSGTYPE_ACK); return IPCOM_ERR_FAILED; } #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS if (ipwps_proto_setup_msg(ctx, ipwps_testapp_proto_ctx, (Ipwps_protomsg_overlay *)ack) == IPCOM_SUCCESS) #endif rc = ipwps_proto_adaptor_send_ACK(ctx, ack); ipcom_free(ack); #else /* Send EAP FAILURE */ #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_DONE :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_SUCCESS); #endif rc = ipwps_proto_adaptor_send_WPS_FIN(ctx); #endif return rc; } /* *=========================================================================== * ipwps_testapp_rcv_ACK *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_ACK(Ipwps_ctx* ctx, Ipwps_protomsg_ACK* ack) { Ip_err rc = IPCOM_SUCCESS; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_ACK called"); ip_assert(ctx); #ifndef IPWPS_WPS_TESTAPP_DONOT_TERMINATE_ON_ACK #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_ACK :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_SUCCESS); #endif rc = ipwps_proto_adaptor_send_WPS_FIN(ctx); #endif return rc; } /* *=========================================================================== * ipwps_testapp_rcv_NACK *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_rcv_NACK(Ipwps_ctx* ctx, Ipwps_protomsg_NACK* nack) { Ip_err rc = IPCOM_ERR_FAILED; IPCOM_LOG0(DEBUG2, "ipwps_testapp_rcv_NACK called"); ip_assert(ctx); #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_NACK :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } #endif ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_ERROR); rc = ipwps_proto_adaptor_send_WPS_FIN(ctx); return rc; } /* *=========================================================================== * ipwps_testapp_notify_wps_finished *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_notify_wps_finished(Ipwps_ctx* ctx) { IPCOM_LOG0(DEBUG2, "ipwps_testapp_notify_wps_finished called"); ip_assert(ctx); #ifndef IPWPS_USE_PROTOMSG_TEST_VECTORS ip_assert(ipwps_testapp_proto_ctx); if (ipwps_testapp_proto_ctx->sm_error) { IPCOM_LOG0(ERR, "ipwps_testapp_rcv_NACK :: IPWPS Proto Handler Error State. Will not process message"); return IPCOM_ERR_FAILED; } ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_SUCCESS); #endif return IPCOM_SUCCESS; } /* *=========================================================================== * ipwps_testapp_notify_wps_timeout *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipwps_testapp_notify_wps_timeout(Ipwps_ctx* ctx) { IPCOM_LOG0(DEBUG2, "ipwps_testapp_notify_wps_timeout called"); ip_assert(ctx); ipwps_ui_report_wps_status(ctx, IPWPS_SESSION_STATUS_ERROR); return IPCOM_ERR_FAILED; } #endif #ifdef IPWPS_USE_WPS_DRV_IF IP_STATIC Ip_err ipwps_testapp_rcv_probe_response_ies ( Ipwps_ctx* ctx, Ipwps_drv_data* drv_data, Ip_u8 no_of_drv_data, Ipwps_drv_event_type event_type ) { Ip_err rc = IPCOM_SUCCESS; Ip_u32 i; if(no_of_drv_data == 0) { IPCOM_LOG1(DEBUG, "ipwps_testapp_rcv_probe_response_ies::no of probe response %d ",no_of_drv_data ); return rc; } if(drv_data==IP_NULL) { return IPCOM_ERR_FAILED; } IPCOM_LOG0(DEBUG, "ipwps_testapp_rcv_probe_response_ies:: received data "); IPCOM_LOG0(DEBUG, "====================================================== "); for(i=0;i