Skip to content

Commit 6a9085e

Browse files
committed
add secured flag to received & transmitted messages in Windows & Linux ports
1 parent 8cc1f16 commit 6a9085e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

port/linux/ipadapter.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ oc_udp_receive_message(ip_context_t *dev, fd_set *fds, oc_message_t *message)
819819
}
820820
#endif /* OC_IPV4 */
821821

822-
#ifdef OC_SECURITY
822+
#ifdef OC_OSCORE
823823
if (FD_ISSET(dev->secure_sock, fds)) {
824824
int count = recv_msg(dev->secure_sock, message->data, OC_PDU_SIZE,
825825
&message->endpoint, false);
@@ -846,7 +846,7 @@ oc_udp_receive_message(ip_context_t *dev, fd_set *fds, oc_message_t *message)
846846
return ADAPTER_STATUS_RECEIVE;
847847
}
848848
#endif /* OC_IPV4 */
849-
#endif /* OC_SECURITY */
849+
#endif /* OC_OSCORE */
850850

851851
return ADAPTER_STATUS_NONE;
852852
}
@@ -1064,8 +1064,7 @@ oc_send_buffer(oc_message_t *message)
10641064
}
10651065
#endif /* OC_TCP */
10661066

1067-
//#ifdef OC_SECURITY
1068-
#ifdef OC_SECURITY
1067+
#ifdef OC_OSCORE
10691068
if (message->endpoint.flags & SECURED) {
10701069
#ifdef OC_IPV4
10711070
if (message->endpoint.flags & IPV4) {

port/windows/ipadapter.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ network_event_thread(void *data)
846846
#endif /* OC_IPV4 */
847847

848848
//#ifdef OC_SECURITY
849-
#ifdef OC_SECURITY /* receiving from a secure socket */
849+
#ifdef OC_OSCORE /* receiving from a secure socket */
850850
if (i == SECURE6) {
851851
int count = recv_msg(dev->secure_sock, message->data, OC_PDU_SIZE,
852852
&message->endpoint, false);
@@ -872,7 +872,7 @@ network_event_thread(void *data)
872872
message->encrypted = 1;
873873
}
874874
#endif /* OC_IPV4 */
875-
#endif /* OC_SECURITY */
875+
#endif /* OC_OSCORE */
876876
common:
877877
#ifdef OC_DEBUG
878878
PRINT("Incoming message of size %zd bytes from ", message->length);
@@ -1138,7 +1138,7 @@ oc_send_buffer(oc_message_t *message)
11381138
#endif /* OC_TCP */
11391139

11401140
//#ifdef OC_SECURITY
1141-
#ifdef OC_SECURITY /* not using secured socket to send*/
1141+
#ifdef OC_OSCORE /* not using secured socket to send*/
11421142
if (message->endpoint.flags & SECURED) {
11431143
#ifdef OC_IPV4
11441144
if (message->endpoint.flags & IPV4) {
@@ -1150,7 +1150,7 @@ oc_send_buffer(oc_message_t *message)
11501150
send_sock = dev->secure_sock;
11511151
#endif /* !OC_IPV4 */
11521152
} else
1153-
#endif /* OC_SECURITY */
1153+
#endif /* OC_OSCORE */
11541154
#ifdef OC_IPV4
11551155
if (message->endpoint.flags & IPV4) {
11561156
send_sock = dev->server4_sock;

0 commit comments

Comments
 (0)