Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3720ca8

Browse files
committed
feat(ssl): Don't need ICACHE_RODATA_ATTR for const
1 parent 5ee5ade commit 3720ca8

File tree

23 files changed

+127
-127
lines changed

23 files changed

+127
-127
lines changed

components/axtls/source/crypto/sha256.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__;
5555
(b)[(i) + 3] = (uint8_t) ((n) ); \
5656
}
5757

58-
static const uint8_t sha256_padding[64] ICACHE_RODATA_ATTR STORE_ATTR =
58+
static const uint8_t sha256_padding[64] =
5959
{
6060
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6161
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

components/axtls/source/crypto/sha512.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__;
5050
#endif
5151

52-
static const uint8_t padding[128] ICACHE_RODATA_ATTR STORE_ATTR =
52+
static const uint8_t padding[128] =
5353
{
5454
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5555
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -61,7 +61,7 @@ static const uint8_t padding[128] ICACHE_RODATA_ATTR STORE_ATTR =
6161
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
6262
};
6363

64-
static const uint64_t k[80] ICACHE_RODATA_ATTR STORE_ATTR =
64+
static const uint64_t k[80] =
6565
{
6666
0x428A2F98D728AE22ULL, 0x7137449123EF65CDULL, 0xB5C0FBCFEC4D3B2FULL, 0xE9B5DBA58189DBBCULL,
6767
0x3956C25BF348B538ULL, 0x59F111F1B605D019ULL, 0x923F82A4AF194F9BULL, 0xAB1C5ED5DA6D8118ULL,

components/axtls/source/crypto/ssl_aes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__;
8181
/*
8282
* AES S-box
8383
*/
84-
static const uint8_t aes_sbox[256] ICACHE_RODATA_ATTR STORE_ATTR =
84+
static const uint8_t aes_sbox[256] =
8585
{
8686
0x63,0x7C,0x77,0x7B,0xF2,0x6B,0x6F,0xC5,
8787
0x30,0x01,0x67,0x2B,0xFE,0xD7,0xAB,0x76,
@@ -120,7 +120,7 @@ static const uint8_t aes_sbox[256] ICACHE_RODATA_ATTR STORE_ATTR =
120120
/*
121121
* AES is-box
122122
*/
123-
static const uint8_t aes_isbox[256] ICACHE_RODATA_ATTR STORE_ATTR =
123+
static const uint8_t aes_isbox[256] =
124124
{
125125
0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38,
126126
0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb,
@@ -156,7 +156,7 @@ static const uint8_t aes_isbox[256] ICACHE_RODATA_ATTR STORE_ATTR =
156156
0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
157157
};
158158

159-
static const unsigned char Rcon[30] ICACHE_RODATA_ATTR STORE_ATTR =
159+
static const unsigned char Rcon[30] =
160160
{
161161
0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,
162162
0x1b,0x36,0x6c,0xd8,0xab,0x4d,0x9a,0x2f,

components/axtls/source/crypto/ssl_crypto_misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static HCRYPTPROV gCryptProv;
6161
static uint8_t entropy_pool[ENTROPY_POOL_SIZE];
6262
#endif
6363

64-
const char unsupported_str[] ICACHE_RODATA_ATTR STORE_ATTR = "Error: Feature not supported\n";
64+
const char unsupported_str[] = "Error: Feature not supported\n";
6565

6666
#ifndef CONFIG_SSL_SKELETON_MODE
6767
/**
@@ -338,7 +338,7 @@ EXP_FUNC void STDCALL print_blob(const char *format, const unsigned char *data,
338338

339339
#if defined(CONFIG_SSL_HAS_PEM) || defined(CONFIG_HTTP_HAS_AUTHORIZATION)
340340
/* base64 to binary lookup table */
341-
static const uint8_t map[128] ICACHE_RODATA_ATTR STORE_ATTR =
341+
static const uint8_t map[128] =
342342
{
343343
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
344344
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,

components/axtls/source/ssl/ssl_loader.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,23 +191,23 @@ void ICACHE_FLASH_ATTR ssl_obj_free(SSLObjLoader *ssl_obj)
191191
#define IS_PRIVATE_KEY 2
192192
#define IS_CERTIFICATE 3
193193

194-
static const char begins[NUM_PEM_TYPES][40] ICACHE_RODATA_ATTR STORE_ATTR =
194+
static const char begins[NUM_PEM_TYPES][40] =
195195
{
196196
"-----BEGIN RSA PRIVATE KEY-----",
197197
"-----BEGIN ENCRYPTED PRIVATE KEY-----",
198198
"-----BEGIN PRIVATE KEY-----",
199199
"-----BEGIN CERTIFICATE-----",
200200
};
201201

202-
static const char ends[NUM_PEM_TYPES][40] ICACHE_RODATA_ATTR STORE_ATTR =
202+
static const char ends[NUM_PEM_TYPES][40] =
203203
{
204204
"-----END RSA PRIVATE KEY-----",
205205
"-----END ENCRYPTED PRIVATE KEY-----",
206206
"-----END PRIVATE KEY-----",
207207
"-----END CERTIFICATE-----",
208208
};
209209

210-
static const char aes_str[2][24] ICACHE_RODATA_ATTR STORE_ATTR =
210+
static const char aes_str[2][24] =
211211
{
212212
"DEK-Info: AES-128-CBC,",
213213
"DEK-Info: AES-256-CBC,"

components/axtls/source/ssl/ssl_platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ char *ICACHE_FLASH_ATTR esp_EVP_cleanup(void)
107107
return NULL;
108108
}
109109

110-
static const unsigned char base64_enc_map[64] ICACHE_RODATA_ATTR STORE_ATTR =
110+
static const unsigned char base64_enc_map[64] =
111111
{
112112
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
113113
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',

components/axtls/source/ssl/ssl_tls1.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__;
4444
/* The session expiry time */
4545
#define SSL_EXPIRY_TIME (CONFIG_SSL_EXPIRY_TIME*3600)
4646

47-
static const uint8_t g_hello_request[] ICACHE_RODATA_ATTR STORE_ATTR = { HS_HELLO_REQUEST, 0, 0, 0 };
48-
static const uint8_t g_chg_cipher_spec_pkt[] ICACHE_RODATA_ATTR STORE_ATTR = { 1 };
49-
static const char server_finished[] ICACHE_RODATA_ATTR STORE_ATTR = "server finished";
50-
static const char client_finished[] ICACHE_RODATA_ATTR STORE_ATTR = "client finished";
47+
static const uint8_t g_hello_request[] = { HS_HELLO_REQUEST, 0, 0, 0 };
48+
static const uint8_t g_chg_cipher_spec_pkt[] = { 1 };
49+
static const char server_finished[] = "server finished";
50+
static const char client_finished[] = "client finished";
5151

5252
static int do_handshake(SSL *ssl, uint8_t *buf, int read_len);
5353
static int set_key_block(SSL *ssl, int is_write);
@@ -65,7 +65,7 @@ const uint8_t ssl_prot_prefs[NUM_PROTOCOLS] =
6565
#else
6666
static void session_free(SSL_SESSION *ssl_sessions[], int sess_index);
6767

68-
const uint8_t ssl_prot_prefs[NUM_PROTOCOLS] ICACHE_RODATA_ATTR STORE_ATTR =
68+
const uint8_t ssl_prot_prefs[NUM_PROTOCOLS] =
6969
#ifdef CONFIG_SSL_PROT_LOW /* low security, fast speed */
7070
{ SSL_RC4_128_SHA, SSL_AES128_SHA, SSL_AES256_SHA, SSL_RC4_128_MD5 };
7171
#elif CONFIG_SSL_PROT_MEDIUM /* medium security, medium speed */

components/axtls/source/ssl/ssl_tls1_svr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "ssl/ssl_os_port.h"
3232
#include "ssl/ssl_ssl.h"
3333

34-
static const uint8_t g_hello_done[] ICACHE_RODATA_ATTR STORE_ATTR = { HS_SERVER_HELLO_DONE, 0, 0, 0 };
34+
static const uint8_t g_hello_done[] = { HS_SERVER_HELLO_DONE, 0, 0, 0 };
3535

3636
#ifdef MEMLEAK_DEBUG
3737
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__;
@@ -435,7 +435,7 @@ static int ICACHE_FLASH_ATTR process_client_key_xchg(SSL *ssl)
435435
}
436436

437437
#ifdef CONFIG_SSL_CERT_VERIFICATION
438-
static const uint8_t g_cert_request[] ICACHE_RODATA_ATTR STORE_ATTR = { HS_CERT_REQ, 0, 0, 4, 1, 0, 0, 0 };
438+
static const uint8_t g_cert_request[] = { HS_CERT_REQ, 0, 0, 4, 1, 0, 0, 0 };
439439

440440
/*
441441
* Send the certificate request message.

components/mbedtls/source/library/aes.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int aes_padlock_ace = -1;
9292
/*
9393
* Forward S-box
9494
*/
95-
static const unsigned char FSb[256] ICACHE_RODATA_ATTR STORE_ATTR =
95+
static const unsigned char FSb[256] =
9696
{
9797
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5,
9898
0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
@@ -199,27 +199,27 @@ static const unsigned char FSb[256] ICACHE_RODATA_ATTR STORE_ATTR =
199199
V(CB,B0,B0,7B), V(FC,54,54,A8), V(D6,BB,BB,6D), V(3A,16,16,2C)
200200

201201
#define V(a,b,c,d) 0x##a##b##c##d
202-
static const uint32_t FT0[256] ICACHE_RODATA_ATTR STORE_ATTR = { FT };
202+
static const uint32_t FT0[256] = { FT };
203203
#undef V
204204

205205
#define V(a,b,c,d) 0x##b##c##d##a
206-
static const uint32_t FT1[256] ICACHE_RODATA_ATTR STORE_ATTR = { FT };
206+
static const uint32_t FT1[256] = { FT };
207207
#undef V
208208

209209
#define V(a,b,c,d) 0x##c##d##a##b
210-
static const uint32_t FT2[256] ICACHE_RODATA_ATTR STORE_ATTR = { FT };
210+
static const uint32_t FT2[256] = { FT };
211211
#undef V
212212

213213
#define V(a,b,c,d) 0x##d##a##b##c
214-
static const uint32_t FT3[256] ICACHE_RODATA_ATTR STORE_ATTR = { FT };
214+
static const uint32_t FT3[256] = { FT };
215215
#undef V
216216

217217
#undef FT
218218

219219
/*
220220
* Reverse S-box
221221
*/
222-
static const unsigned char RSb[256] ICACHE_RODATA_ATTR STORE_ATTR =
222+
static const unsigned char RSb[256] =
223223
{
224224
0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38,
225225
0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
@@ -326,27 +326,27 @@ static const unsigned char RSb[256] ICACHE_RODATA_ATTR STORE_ATTR =
326326
V(61,84,CB,7B), V(70,B6,32,D5), V(74,5C,6C,48), V(42,57,B8,D0)
327327

328328
#define V(a,b,c,d) 0x##a##b##c##d
329-
static const uint32_t RT0[256] ICACHE_RODATA_ATTR STORE_ATTR = { RT };
329+
static const uint32_t RT0[256] = { RT };
330330
#undef V
331331

332332
#define V(a,b,c,d) 0x##b##c##d##a
333-
static const uint32_t RT1[256] ICACHE_RODATA_ATTR STORE_ATTR = { RT };
333+
static const uint32_t RT1[256] = { RT };
334334
#undef V
335335

336336
#define V(a,b,c,d) 0x##c##d##a##b
337-
static const uint32_t RT2[256] ICACHE_RODATA_ATTR STORE_ATTR = { RT };
337+
static const uint32_t RT2[256] = { RT };
338338
#undef V
339339

340340
#define V(a,b,c,d) 0x##d##a##b##c
341-
static const uint32_t RT3[256] ICACHE_RODATA_ATTR STORE_ATTR = { RT };
341+
static const uint32_t RT3[256] = { RT };
342342
#undef V
343343

344344
#undef RT
345345

346346
/*
347347
* Round constants
348348
*/
349-
static const uint32_t RCON[10] ICACHE_RODATA_ATTR =
349+
static const uint32_t RCON[10] =
350350
{
351351
0x00000001, 0x00000002, 0x00000004, 0x00000008,
352352
0x00000010, 0x00000020, 0x00000040, 0x00000080,

components/mbedtls/source/library/base64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#endif /* MBEDTLS_PLATFORM_C */
4242
#endif /* MBEDTLS_SELF_TEST */
4343

44-
static const unsigned char base64_enc_map[64] ICACHE_RODATA_ATTR =
44+
static const unsigned char base64_enc_map[64] =
4545
{
4646
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
4747
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
@@ -52,7 +52,7 @@ static const unsigned char base64_enc_map[64] ICACHE_RODATA_ATTR =
5252
'8', '9', '+', '/'
5353
};
5454

55-
static const unsigned char base64_dec_map[128] ICACHE_RODATA_ATTR =
55+
static const unsigned char base64_dec_map[128] =
5656
{
5757
127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
5858
127, 127, 127, 127, 127, 127, 127, 127, 127, 127,

0 commit comments

Comments
 (0)