mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-05 13:16:13 +03:00
more axhttpd work
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@55 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright(C) 2006 Cameron Rich
|
||||
# Copyright(C) 2007 Cameron Rich
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
|
12
ssl/bigint.c
12
ssl/bigint.c
@@ -285,7 +285,7 @@ bigint *bi_add(BI_CTX *ctx, bigint *bia, bigint *bib)
|
||||
* @param bia [in] A bigint.
|
||||
* @param bib [in] Another bigint.
|
||||
* @param is_negative [out] If defined, indicates that the result was negative.
|
||||
* is_negative may be NULL.
|
||||
* is_negative may be null.
|
||||
* @return The result of the subtraction. The result is always positive.
|
||||
*/
|
||||
bigint *bi_subtract(BI_CTX *ctx,
|
||||
@@ -1059,7 +1059,7 @@ static bigint *alloc(BI_CTX *ctx, int size)
|
||||
#ifdef CONFIG_SSL_FULL_MODE
|
||||
printf("alloc: refs was not 0\n");
|
||||
#endif
|
||||
abort();
|
||||
abort(); /* create a stack trace from a core dump */
|
||||
}
|
||||
|
||||
more_comps(biR, size);
|
||||
@@ -1220,7 +1220,7 @@ static bigint *comp_mod(bigint *bi, int mod)
|
||||
/*
|
||||
* Barrett reduction has no need for some parts of the product, so ignore bits
|
||||
* of the multiply. This routine gives Barrett its big performance
|
||||
* improvements over classical/Montgomery reduction methods.
|
||||
* improvements over Classical/Montgomery reduction methods.
|
||||
*/
|
||||
static bigint *partial_multiply(BI_CTX *ctx, bigint *bia, bigint *bib,
|
||||
int inner_partial, int outer_partial)
|
||||
@@ -1293,10 +1293,10 @@ static bigint *partial_multiply(BI_CTX *ctx, bigint *bia, bigint *bib,
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Perform a single barrett reduction.
|
||||
* @brief Perform a single Barrett reduction.
|
||||
* @param ctx [in] The bigint session context.
|
||||
* @param bi [in] A bigint.
|
||||
* @return The result of the barrett reduction.
|
||||
* @return The result of the Barrett reduction.
|
||||
*/
|
||||
bigint *bi_barrett(BI_CTX *ctx, bigint *bi)
|
||||
{
|
||||
@@ -1308,7 +1308,7 @@ bigint *bi_barrett(BI_CTX *ctx, bigint *bi)
|
||||
check(bi);
|
||||
check(bim);
|
||||
|
||||
/* use classical method instead - Barrett cannot help here */
|
||||
/* use Classical method instead - Barrett cannot help here */
|
||||
if (bi->size > k*2)
|
||||
{
|
||||
return bi_mod(ctx, bi);
|
||||
|
@@ -70,7 +70,7 @@ void buf_grow(BUF_MEM *bm, int len)
|
||||
/* add 1kB just to be sure */
|
||||
bm->pre_data = (uint8_t *)realloc(bm->pre_data, len+1024+BM_RECORD_OFFSET);
|
||||
bm->data = bm->pre_data+BM_RECORD_OFFSET;
|
||||
bm->max_len = len+1024;
|
||||
bm->max_len = len + 1024;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -769,7 +769,7 @@ static void prf(const uint8_t *sec, int sec_len, uint8_t *seed, int seed_len,
|
||||
len = sec_len/2;
|
||||
S1 = sec;
|
||||
S2 = &sec[len];
|
||||
len += (sec_len&1); /* add for odd, make longer */
|
||||
len += (sec_len & 1); /* add for odd, make longer */
|
||||
|
||||
p_hash_md5(S1, len, seed, seed_len, xbuf, olen);
|
||||
p_hash_sha1(S2, len, seed, seed_len, ybuf, olen);
|
||||
@@ -842,6 +842,7 @@ void finished_digest(SSL *ssl, const char *label, uint8_t *digest)
|
||||
{
|
||||
memcpy(digest, mac_buf, MD5_SIZE + SHA1_SIZE);
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("label: %s\n", label);
|
||||
print_blob("master secret", ssl->master_secret, 48);
|
||||
@@ -1121,9 +1122,11 @@ int basic_read(SSL *ssl, uint8_t **in_data)
|
||||
{
|
||||
int ret = SSL_OK;
|
||||
int read_len, is_record;
|
||||
uint8_t *buf = ssl->bm_buf.data;
|
||||
int is_client = IS_SET_SSL_FLAG(SSL_IS_CLIENT);
|
||||
uint8_t *buf;
|
||||
|
||||
buf_grow(&ssl->bm_buf, ssl->need_bytes);
|
||||
buf = ssl->bm_buf.data;
|
||||
read_len = SOCKET_READ(ssl->client_fd, &buf[ssl->bm_buf.index],
|
||||
ssl->need_bytes-ssl->got_bytes);
|
||||
|
||||
|
Reference in New Issue
Block a user