Skip to content

Commit

Permalink
Remove default private key and certificate (esp8266#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Dec 4, 2015
1 parent 34ff442 commit 1551076
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 104 deletions.
43 changes: 0 additions & 43 deletions ssl/cert.h

This file was deleted.

10 changes: 5 additions & 5 deletions ssl/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ int load_key_certs(SSL_CTX *ssl_ctx)
else if (!(options & SSL_NO_DEFAULT_KEY))
{
#if defined(CONFIG_SSL_USE_DEFAULT_KEY) || defined(CONFIG_SSL_SKELETON_MODE)
static const /* saves a few more bytes */
#include "private_key.h"
extern const unsigned char* default_private_key;
extern const unsigned int default_private_key_len;

ssl_obj_memory_load(ssl_ctx, SSL_OBJ_RSA_KEY, default_private_key,
default_private_key_len, NULL);
Expand All @@ -462,9 +462,9 @@ int load_key_certs(SSL_CTX *ssl_ctx)
else if (!(options & SSL_NO_DEFAULT_KEY))
{
#if defined(CONFIG_SSL_USE_DEFAULT_KEY) || defined(CONFIG_SSL_SKELETON_MODE)
static const /* saves a few bytes and RAM */
#include "cert.h"
ssl_obj_memory_load(ssl_ctx, SSL_OBJ_X509_CERT,
extern const unsigned char* default_certificate;
extern const unsigned int default_certificate_len;
ssl_obj_memory_load(ssl_ctx, SSL_OBJ_X509_CERT,
default_certificate, default_certificate_len, NULL);
#endif
}
Expand Down
54 changes: 0 additions & 54 deletions ssl/private_key.h

This file was deleted.

4 changes: 2 additions & 2 deletions ssl/tls1.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,13 +650,13 @@ static void increment_write_sequence(SSL *ssl)
static void add_hmac_digest(SSL *ssl, int mode, uint8_t *hmac_header,
const uint8_t *buf, int buf_len, uint8_t *hmac_buf)
{
const prefix_size = 8 + SSL_RECORD_SIZE;
const size_t prefix_size = 8 + SSL_RECORD_SIZE;
bool hmac_inplace = (uint32_t)buf - (uint32_t)ssl->bm_data >= prefix_size;
uint8_t tmp[prefix_size];
int hmac_len = buf_len + prefix_size;
uint8_t *t_buf;
if (hmac_inplace) {
t_buf = buf - prefix_size;
t_buf = ((uint8_t*)buf) - prefix_size;
memcpy(tmp, t_buf, prefix_size);
} else {
t_buf = (uint8_t *)malloc(hmac_len+10);
Expand Down

0 comments on commit 1551076

Please sign in to comment.