Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
296affc6
Commit
296affc6
authored
Nov 10, 2016
by
Deomid Ryabkov
Committed by
Cesanta Bot
Nov 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Krypton define KR_VERSION; use it to detect
PUBLISHED_FROM=ea039cdc30aec44db074871ff6b2d2582f98b5c9
parent
1889e12b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
examples.mk
examples/examples.mk
+1
-1
mongoose.c
mongoose.c
+8
-8
No files found.
examples/examples.mk
View file @
296affc6
...
@@ -11,7 +11,7 @@ else
...
@@ -11,7 +11,7 @@ else
ifeq ($(SSL_LIB),openssl)
ifeq ($(SSL_LIB),openssl)
CFLAGS += -DMG_ENABLE_SSL -lssl -lcrypto
CFLAGS += -DMG_ENABLE_SSL -lssl -lcrypto
else ifeq ($(SSL_LIB), krypton)
else ifeq ($(SSL_LIB), krypton)
CFLAGS += -DMG_ENABLE_SSL -DMG_DISABLE_PFS
-DSSL_KRYPTON
../../../krypton/krypton.c -I../../../krypton
CFLAGS += -DMG_ENABLE_SSL -DMG_DISABLE_PFS ../../../krypton/krypton.c -I../../../krypton
endif
endif
CFLAGS += -lpthread
CFLAGS += -lpthread
endif
endif
...
...
mongoose.c
View file @
296affc6
...
@@ -2685,7 +2685,7 @@ struct mg_connection *mg_connect(struct mg_mgr *mgr, const char *address,
...
@@ -2685,7 +2685,7 @@ struct mg_connection *mg_connect(struct mg_mgr *mgr, const char *address,
static
void
mg_set_ssl_server_name
(
struct
mg_connection
*
nc
,
static
void
mg_set_ssl_server_name
(
struct
mg_connection
*
nc
,
const
char
*
server_name
)
{
const
char
*
server_name
)
{
DBG
((
"%p '%s'"
,
nc
,
server_name
));
DBG
((
"%p '%s'"
,
nc
,
server_name
));
#ifdef
SSL_KRYPT
ON
#ifdef
KR_VERSI
ON
SSL_CTX_kr_set_verify_name
(
nc
->
ssl_ctx
,
server_name
);
SSL_CTX_kr_set_verify_name
(
nc
->
ssl_ctx
,
server_name
);
#elif MG_NET_IF == MG_NET_IF_SIMPLELINK
#elif MG_NET_IF == MG_NET_IF_SIMPLELINK
nc
->
ssl_server_name
=
strdup
(
server_name
);
nc
->
ssl_server_name
=
strdup
(
server_name
);
...
@@ -12599,7 +12599,7 @@ static err_t mg_lwip_tcp_recv_cb(void *arg, struct tcp_pcb *tpcb,
...
@@ -12599,7 +12599,7 @@ static err_t mg_lwip_tcp_recv_cb(void *arg, struct tcp_pcb *tpcb,
static
void
mg_lwip_handle_recv
(
struct
mg_connection
*
nc
)
{
static
void
mg_lwip_handle_recv
(
struct
mg_connection
*
nc
)
{
struct
mg_lwip_conn_state
*
cs
=
(
struct
mg_lwip_conn_state
*
)
nc
->
sock
;
struct
mg_lwip_conn_state
*
cs
=
(
struct
mg_lwip_conn_state
*
)
nc
->
sock
;
#ifdef
SSL_KRYPT
ON
#ifdef
KR_VERSI
ON
if
(
nc
->
ssl
!=
NULL
)
{
if
(
nc
->
ssl
!=
NULL
)
{
if
(
nc
->
flags
&
MG_F_SSL_HANDSHAKE_DONE
)
{
if
(
nc
->
flags
&
MG_F_SSL_HANDSHAKE_DONE
)
{
mg_lwip_ssl_recv
(
nc
);
mg_lwip_ssl_recv
(
nc
);
...
@@ -12743,7 +12743,7 @@ static err_t mg_lwip_accept_cb(void *arg, struct tcp_pcb *newtpcb, err_t err) {
...
@@ -12743,7 +12743,7 @@ static err_t mg_lwip_accept_cb(void *arg, struct tcp_pcb *newtpcb, err_t err) {
#if LWIP_TCP_KEEPALIVE
#if LWIP_TCP_KEEPALIVE
mg_lwip_set_keepalive_params
(
nc
,
60
,
10
,
6
);
mg_lwip_set_keepalive_params
(
nc
,
60
,
10
,
6
);
#endif
#endif
#ifdef
SSL_KRYPT
ON
#ifdef
KR_VERSI
ON
if
(
lc
->
ssl_ctx
!=
NULL
)
{
if
(
lc
->
ssl_ctx
!=
NULL
)
{
nc
->
ssl
=
SSL_new
(
lc
->
ssl_ctx
);
nc
->
ssl
=
SSL_new
(
lc
->
ssl_ctx
);
if
(
nc
->
ssl
==
NULL
||
SSL_set_fd
(
nc
->
ssl
,
(
intptr_t
)
nc
)
!=
1
)
{
if
(
nc
->
ssl
==
NULL
||
SSL_set_fd
(
nc
->
ssl
,
(
intptr_t
)
nc
)
!=
1
)
{
...
@@ -13025,7 +13025,7 @@ void mg_ev_mgr_lwip_process_signals(struct mg_mgr *mgr) {
...
@@ -13025,7 +13025,7 @@ void mg_ev_mgr_lwip_process_signals(struct mg_mgr *mgr) {
struct
mg_lwip_conn_state
*
cs
=
(
struct
mg_lwip_conn_state
*
)
nc
->
sock
;
struct
mg_lwip_conn_state
*
cs
=
(
struct
mg_lwip_conn_state
*
)
nc
->
sock
;
switch
(
md
->
sig_queue
[
md
->
start_index
].
sig
)
{
switch
(
md
->
sig_queue
[
md
->
start_index
].
sig
)
{
case
MG_SIG_CONNECT_RESULT
:
{
case
MG_SIG_CONNECT_RESULT
:
{
#ifdef
SSL_KRYPT
ON
#ifdef
KR_VERSI
ON
if
(
cs
->
err
==
0
&&
nc
->
flags
&
MG_F_SSL
&&
if
(
cs
->
err
==
0
&&
nc
->
flags
&
MG_F_SSL
&&
!
(
nc
->
flags
&
MG_F_SSL_HANDSHAKE_DONE
))
{
!
(
nc
->
flags
&
MG_F_SSL_HANDSHAKE_DONE
))
{
SSL_set_fd
(
nc
->
ssl
,
(
intptr_t
)
nc
);
SSL_set_fd
(
nc
->
ssl
,
(
intptr_t
)
nc
);
...
@@ -13112,7 +13112,7 @@ time_t mg_lwip_if_poll(struct mg_iface *iface, int timeout_ms) {
...
@@ -13112,7 +13112,7 @@ time_t mg_lwip_if_poll(struct mg_iface *iface, int timeout_ms) {
mg_close_conn
(
nc
);
mg_close_conn
(
nc
);
continue
;
continue
;
}
}
#ifdef
SSL_KRYPT
ON
#ifdef
KR_VERSI
ON
if
(
nc
->
ssl
!=
NULL
&&
cs
!=
NULL
&&
cs
->
pcb
.
tcp
!=
NULL
&&
if
(
nc
->
ssl
!=
NULL
&&
cs
!=
NULL
&&
cs
->
pcb
.
tcp
!=
NULL
&&
cs
->
pcb
.
tcp
->
state
==
ESTABLISHED
)
{
cs
->
pcb
.
tcp
->
state
==
ESTABLISHED
)
{
if
(((
nc
->
flags
&
MG_F_WANT_WRITE
)
||
nc
->
send_mbuf
.
len
>
0
)
&&
if
(((
nc
->
flags
&
MG_F_WANT_WRITE
)
||
nc
->
send_mbuf
.
len
>
0
)
&&
...
@@ -13132,7 +13132,7 @@ time_t mg_lwip_if_poll(struct mg_iface *iface, int timeout_ms) {
...
@@ -13132,7 +13132,7 @@ time_t mg_lwip_if_poll(struct mg_iface *iface, int timeout_ms) {
}
}
}
}
}
else
}
else
#endif
/*
SSL_KRYPT
ON */
#endif
/*
KR_VERSI
ON */
{
{
if
(
!
(
nc
->
flags
&
(
MG_F_CONNECTING
|
MG_F_UDP
)))
{
if
(
!
(
nc
->
flags
&
(
MG_F_CONNECTING
|
MG_F_UDP
)))
{
if
(
nc
->
send_mbuf
.
len
>
0
)
mg_lwip_send_more
(
nc
);
if
(
nc
->
send_mbuf
.
len
>
0
)
mg_lwip_send_more
(
nc
);
...
@@ -13187,7 +13187,7 @@ uint32_t mg_lwip_get_poll_delay_ms(struct mg_mgr *mgr) {
...
@@ -13187,7 +13187,7 @@ uint32_t mg_lwip_get_poll_delay_ms(struct mg_mgr *mgr) {
* All rights reserved
* All rights reserved
*/
*/
#if MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL &&
defined(SSL_KRYPT
ON)
#if MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL &&
MG_ENABLE_SSL && defined(KR_VERSI
ON)
/* Amalgamated: #include "common/cs_dbg.h" */
/* Amalgamated: #include "common/cs_dbg.h" */
...
@@ -13346,7 +13346,7 @@ ssize_t kr_recv(int fd, void *buf, size_t len) {
...
@@ -13346,7 +13346,7 @@ ssize_t kr_recv(int fd, void *buf, size_t len) {
return
len
;
return
len
;
}
}
#endif
/* MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL &&
defined(SSL_KRYPT
ON) */
#endif
/* MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL &&
MG_ENABLE_SSL && defined(KR_VERSI
ON) */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line 1 "common/platforms/wince/wince_libc.c"
#line 1 "common/platforms/wince/wince_libc.c"
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment