Skip to content

Commit 3ee5fdd

Browse files
committed
rename files, differentiating between sdk versions
1 parent 4a30cd8 commit 3ee5fdd

File tree

12 files changed

+217
-71
lines changed

12 files changed

+217
-71
lines changed

peap/user/user_main.c

Lines changed: 0 additions & 70 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

wpa2e-v20/user/ca.h

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
unsigned char ca[] = {
2+
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
3+
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
4+
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x42, 0x77, 0x6a, 0x43, 0x43,
5+
0x41, 0x57, 0x79, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a,
6+
0x41, 0x4c, 0x6b, 0x2f, 0x63, 0x39, 0x6b, 0x2b, 0x49, 0x63, 0x6c, 0x61,
7+
0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33,
8+
0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, 0x43, 0x49, 0x78,
9+
0x49, 0x44, 0x41, 0x65, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d,
10+
0x54, 0x46, 0x30, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c,
11+
0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56,
12+
0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x42, 0x34,
13+
0x58, 0x44, 0x54, 0x45, 0x32, 0x4d, 0x44, 0x49, 0x78, 0x4d, 0x6a, 0x45,
14+
0x31, 0x4e, 0x44, 0x49, 0x31, 0x4d, 0x56, 0x6f, 0x58, 0x44, 0x54, 0x45,
15+
0x35, 0x0a, 0x4d, 0x44, 0x49, 0x78, 0x4d, 0x54, 0x45, 0x31, 0x4e, 0x44,
16+
0x49, 0x31, 0x4d, 0x56, 0x6f, 0x77, 0x49, 0x6a, 0x45, 0x67, 0x4d, 0x42,
17+
0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x58, 0x51, 0x32,
18+
0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47,
19+
0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33,
20+
0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, 0x0a, 0x58, 0x44, 0x41, 0x4e, 0x42,
21+
0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41,
22+
0x51, 0x45, 0x46, 0x41, 0x41, 0x4e, 0x4c, 0x41, 0x44, 0x42, 0x49, 0x41,
23+
0x6b, 0x45, 0x41, 0x76, 0x4e, 0x6c, 0x46, 0x51, 0x62, 0x41, 0x64, 0x32,
24+
0x47, 0x39, 0x61, 0x46, 0x79, 0x47, 0x71, 0x57, 0x4e, 0x45, 0x79, 0x61,
25+
0x57, 0x72, 0x59, 0x4b, 0x75, 0x4d, 0x41, 0x39, 0x47, 0x51, 0x6f, 0x0a,
26+
0x74, 0x77, 0x4f, 0x2f, 0x59, 0x31, 0x38, 0x73, 0x31, 0x6b, 0x73, 0x70,
27+
0x2f, 0x32, 0x48, 0x36, 0x68, 0x65, 0x52, 0x62, 0x6a, 0x59, 0x37, 0x6a,
28+
0x51, 0x6b, 0x71, 0x4d, 0x61, 0x72, 0x31, 0x33, 0x73, 0x6f, 0x47, 0x46,
29+
0x35, 0x77, 0x6e, 0x51, 0x30, 0x44, 0x45, 0x48, 0x44, 0x2f, 0x54, 0x71,
30+
0x79, 0x6f, 0x51, 0x6d, 0x77, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42,
31+
0x6f, 0x34, 0x47, 0x45, 0x0a, 0x4d, 0x49, 0x47, 0x42, 0x4d, 0x42, 0x30,
32+
0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x54,
33+
0x69, 0x50, 0x46, 0x36, 0x6f, 0x53, 0x42, 0x71, 0x36, 0x65, 0x2f, 0x65,
34+
0x57, 0x4c, 0x59, 0x79, 0x62, 0x59, 0x58, 0x78, 0x6f, 0x79, 0x4d, 0x6d,
35+
0x34, 0x4b, 0x54, 0x42, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d,
36+
0x45, 0x53, 0x7a, 0x42, 0x4a, 0x67, 0x42, 0x54, 0x69, 0x0a, 0x50, 0x46,
37+
0x36, 0x6f, 0x53, 0x42, 0x71, 0x36, 0x65, 0x2f, 0x65, 0x57, 0x4c, 0x59,
38+
0x79, 0x62, 0x59, 0x58, 0x78, 0x6f, 0x79, 0x4d, 0x6d, 0x34, 0x4b, 0x61,
39+
0x45, 0x6d, 0x70, 0x43, 0x51, 0x77, 0x49, 0x6a, 0x45, 0x67, 0x4d, 0x42,
40+
0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x58, 0x51, 0x32,
41+
0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47,
42+
0x6c, 0x76, 0x0a, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62,
43+
0x33, 0x4a, 0x70, 0x64, 0x48, 0x6d, 0x43, 0x43, 0x51, 0x43, 0x35, 0x50,
44+
0x33, 0x50, 0x5a, 0x50, 0x69, 0x48, 0x4a, 0x57, 0x6a, 0x41, 0x4d, 0x42,
45+
0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41,
46+
0x51, 0x48, 0x2f, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53,
47+
0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x0a, 0x42, 0x51, 0x55, 0x41,
48+
0x41, 0x30, 0x45, 0x41, 0x75, 0x59, 0x49, 0x4d, 0x4b, 0x4d, 0x68, 0x30,
49+
0x4c, 0x39, 0x47, 0x44, 0x41, 0x63, 0x37, 0x74, 0x59, 0x55, 0x44, 0x5a,
50+
0x49, 0x77, 0x38, 0x6d, 0x71, 0x45, 0x69, 0x38, 0x7a, 0x33, 0x6e, 0x6c,
51+
0x33, 0x56, 0x5a, 0x4d, 0x57, 0x74, 0x56, 0x33, 0x4c, 0x39, 0x62, 0x64,
52+
0x35, 0x46, 0x70, 0x53, 0x53, 0x74, 0x4f, 0x2b, 0x32, 0x50, 0x4c, 0x4e,
53+
0x0a, 0x52, 0x34, 0x78, 0x70, 0x55, 0x53, 0x4c, 0x33, 0x57, 0x39, 0x65,
54+
0x45, 0x4c, 0x49, 0x73, 0x69, 0x79, 0x52, 0x57, 0x32, 0x77, 0x53, 0x77,
55+
0x78, 0x55, 0x6e, 0x7a, 0x73, 0x64, 0x51, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d,
56+
0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49,
57+
0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
58+
};
59+
unsigned int ca_len = 672;
60+
File renamed without changes.

wpa2e-v20/user/user_main.c

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#include "ets_sys.h"
2+
#include "osapi.h"
3+
#include "os_type.h"
4+
#include "gpio.h"
5+
#include "user_interface.h"
6+
7+
#include "user_config.h"
8+
#include "ca.h"
9+
10+
#define WIFI_LED_IO_MUX PERIPHS_IO_MUX_GPIO2_U
11+
#define WIFI_LED_IO_NUM 2
12+
#define WIFI_LED_IO_FUNC FUNC_GPIO2
13+
14+
void wifi_handle_event_cb(System_Event_t *evt)
15+
{
16+
switch (evt->event) {
17+
case EVENT_STAMODE_CONNECTED:
18+
os_printf("[connect to ssid %s, channel %d]\n",
19+
evt->event_info.connected.ssid,
20+
evt->event_info.connected.channel);
21+
break;
22+
case EVENT_STAMODE_DISCONNECTED:
23+
os_printf("[disconnect from ssid %s, reason %d]\n",
24+
evt->event_info.disconnected.ssid,
25+
evt->event_info.disconnected.reason);
26+
break;
27+
case EVENT_STAMODE_AUTHMODE_CHANGE:
28+
os_printf("[mode: %d -> %d]\n",
29+
evt->event_info.auth_change.old_mode,
30+
evt->event_info.auth_change.new_mode);
31+
break;
32+
case EVENT_STAMODE_GOT_IP:
33+
os_printf("[ip:" IPSTR ",mask:" IPSTR ",gw:" IPSTR "]\n",
34+
IP2STR(&evt->event_info.got_ip.ip),
35+
IP2STR(&evt->event_info.got_ip.mask),
36+
IP2STR(&evt->event_info.got_ip.gw));
37+
break;
38+
default:
39+
os_printf("[event: %x]\n", evt->event);
40+
break;
41+
}
42+
}
43+
44+
void ICACHE_FLASH_ATTR user_init(void)
45+
{
46+
struct station_config wifi_config;
47+
48+
uart_div_modify(0, UART_CLK_FREQ/9600);
49+
os_delay_us(1000000);
50+
51+
wifi_status_led_install(WIFI_LED_IO_NUM, WIFI_LED_IO_MUX, FUNC_GPIO0);
52+
os_printf("[SDK version:%s]\n", system_get_sdk_version());
53+
54+
// station mode:
55+
if( !wifi_set_opmode(STATION_MODE) ) {
56+
os_printf("[failed setting station mode]\n");
57+
}
58+
59+
// set station configuration, save to flash
60+
os_memset(&wifi_config,0,sizeof(wifi_config));
61+
os_strcpy(wifi_config.ssid, SSID, os_strlen(SSID));
62+
//os_strcpy(wifi_config.password, PSK, os_strlen(PSK)); // only for WPA2-PSK
63+
os_strcpy(wifi_config.password, "", os_strlen("")); // only for WPA2-Enterprise
64+
wifi_station_set_config(&wifi_config);
65+
66+
// WPA2-Enterprise
67+
wifi_station_set_wpa2_enterprise_auth(1);
68+
// ignore CA Certificate when testing
69+
wifi_station_set_enterprise_ca_cert(ca_pem, ca_pem_len + 1);
70+
wifi_station_set_enterprise_username("espressif", os_strlen("espressif"));
71+
wifi_station_set_enterprise_password("test11", os_strlen("test11"));
72+
73+
// no need to call connect() in user_init()
74+
//if( !wifi_station_connect() );
75+
76+
wifi_set_event_handler_cb(wifi_handle_event_cb);
77+
}

x509/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
all: demoCA demoCA/cacert.pem testuser_cert.pem server_cert.pem testuser_key.c testuser_cert.c
1+
all: demoCA demoCA/cacert.pem testuser_cert.pem server_cert.pem testuser_key.c testuser_cert.c ca.h
22

33
# Certification Authority
44

@@ -48,6 +48,14 @@ testuser_key.c: testuser_key.pem
4848
xxd -i testuser_key.pem > testuser_key.c
4949
testuser_cert.c: testuser_cert.pem
5050
xxd -i testuser_cert.pem > testuser_cert.c
51+
52+
# C version of ca cert
53+
54+
ca.pem: demoCA/cacert.pem
55+
openssl x509 -in demoCA/cacert.pem -out ca.pem
56+
57+
ca.h: ca.pem
58+
xxd -i ca.pem > ca.h
5159
#
5260

5361
clean:

0 commit comments

Comments
 (0)