Skip to content

Commit 729978d

Browse files
committed
fix(coap): Update to libcoap v4.3.5a
Fixes some critical issues.
1 parent 4339f0f commit 729978d

File tree

10 files changed

+60
-102
lines changed

10 files changed

+60
-102
lines changed

coap/examples/coap_client/main/coap_client_example_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "protocol_examples_common.h"
3333

34+
#include "coap_config.h"
3435
#include "coap3/coap.h"
3536

3637

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
version: "1.0.0"
1+
version: 1.0.0
22
description: CoAP Client Example
33
dependencies:
44
espressif/coap:
5-
version: "^4.3.0"
6-
override_path: '../../../'
5+
version: ^4.3.0
6+
override_path: ../../../
77
protocol_examples_common:
88
path: ${IDF_PATH}/examples/common_components/protocol_examples_common
9+
espressif/ethernet_init: '*'

coap/examples/coap_server/main/coap_server_example_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "protocol_examples_common.h"
3131

32+
#include "coap_config.h"
3233
#include "coap3/coap.h"
3334

3435
#ifndef CONFIG_COAP_SERVER_SUPPORT
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
version: "1.0.0"
1+
version: 1.0.0
22
description: CoAP Server Example
33
dependencies:
44
espressif/coap:
5-
version: "^4.3.0"
6-
override_path: '../../../'
5+
version: ^4.3.0
6+
override_path: ../../../
77
protocol_examples_common:
88
path: ${IDF_PATH}/examples/common_components/protocol_examples_common
9+
espressif/ethernet_init: '*'

coap/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "4.3.5~3"
1+
version: "4.3.5~4"
22
description: Constrained Application Protocol (CoAP) C Library
33
url: https://github.com/espressif/idf-extra-components/tree/master/coap
44
dependencies:

coap/libcoap

Submodule libcoap updated 182 files

coap/port/include/coap3/coap.h

Lines changed: 0 additions & 82 deletions
This file was deleted.

coap/port/include/coap_config.h

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
/*
22
* libcoap configure implementation for ESP32 platform.
33
*
4-
* Uses libcoap software implementation for failover when concurrent
5-
* configure operations are in use.
6-
*
74
* coap.h -- main header file for CoAP stack of libcoap
85
*
9-
* Copyright (C) 2010-2012,2015-2024 Olaf Bergmann <[email protected]>
6+
* Copyright (C) 2010-2012,2015-2025 Olaf Bergmann <[email protected]>
107
* 2015 Carsten Schoenert <[email protected]>
118
*
129
* Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
@@ -15,8 +12,8 @@
1512
* of use.
1613
*/
1714

18-
#ifndef _CONFIG_H_
19-
#define _CONFIG_H_
15+
#ifndef COAP_CONFIG_H_
16+
#define COAP_CONFIG_H_
2017

2118
/* Always enabled in ESP-IDF */
2219
#ifndef WITH_POSIX
@@ -56,11 +53,30 @@
5653

5754
#ifdef CONFIG_LWIP_IPV4
5855
#define COAP_IPV4_SUPPORT 1
59-
#endif /* CONFIG_LWIP_IPV4 */
56+
#else /* ! CONFIG_LWIP_IPV4 */
57+
struct sockaddr_in {
58+
u8_t sin_len;
59+
sa_family_t sin_family;
60+
in_port_t sin_port;
61+
struct in_addr sin_addr;
62+
};
63+
#endif /* ! CONFIG_LWIP_IPV4 */
6064

6165
#ifdef CONFIG_LWIP_IPV6
6266
#define COAP_IPV6_SUPPORT 1
63-
#endif /* CONFIG_LWIP_IPV6 */
67+
#else /* ! CONFIG_LWIP_IPV6 */
68+
struct sockaddr_in6 {
69+
u8_t sin6_len;
70+
sa_family_t sin6_family;
71+
in_port_t sin6_port;
72+
u32_t sin6_flowinfo;
73+
struct in_addr sin6_addr;
74+
u32_t sin6_scope_id;
75+
};
76+
#ifndef INET6_ADDRSTRLEN
77+
#define INET6_ADDRSTRLEN 40
78+
#endif /* INET6_ADDRSTRLEN */
79+
#endif /* ! CONFIG_LWIP_IPV6 */
6480

6581
#ifdef CONFIG_COAP_ASYNC_SUPPORT
6682
#define COAP_ASYNC_SUPPORT 1
@@ -114,4 +130,4 @@
114130
#define COAP_MAX_LOGGING_LEVEL 0
115131
#endif /* ! CONFIG_COAP_DEBUGGING */
116132

117-
#endif /* _CONFIG_H_ */
133+
#endif /* COAP_CONFIG_H_ */

coap/port/include/coap_config_posix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* coap.h -- main header file for CoAP stack of libcoap
88
*
9-
* Copyright (C) 2010-2012,2015-2024 Olaf Bergmann <[email protected]>
9+
* Copyright (C) 2010-2012,2015-2025 Olaf Bergmann <[email protected]>
1010
* 2015 Carsten Schoenert <[email protected]>
1111
*
1212
* Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
@@ -56,7 +56,7 @@ struct in6_pktinfo {
5656
#define PACKAGE_VERSION "4.3.5"
5757

5858
#ifdef CONFIG_MBEDTLS_TLS_ENABLED
59-
#define COAP_WITH_LIBMBEDTLS
59+
#define COAP_WITH_LIBMBEDTLS 1
6060
#endif /* CONFIG_MBEDTLS_TLS_ENABLED */
6161

6262
#define COAP_DEFAULT_MAX_PDU_RX_SIZE CONFIG_LWIP_TCP_MSL

coap/sbom_libcoap.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cpe: cpe:2.3:a:libcoap:libcoap:{}:*:*:*:*:*:*:*
44
supplier: 'Organization: libcoap <https://libcoap.net/>'
55
description: A CoAP (RFC 7252) implementation in C
66
url: https://github.com/obgm/libcoap
7-
hash: 4d84859620540c8baf06fa094abb9e0ae19da0e7
7+
hash: e3fdcdcfbd1588754fe9dd4b754ac9397260f0f9
88
cve-exclude-list:
99
- cve: CVE-2024-31031
1010
reason: Resolved in version 4.3.5-rc1
@@ -14,3 +14,23 @@ cve-exclude-list:
1414
reason: Resolved in version 4.3.5-rc3
1515
- cve: CVE-2025-50518
1616
reason: Not applicable as per comment https://github.com/obgm/libcoap/issues/1724#issuecomment-3296780541
17+
- cve: CVE-2025-59391
18+
reason: Resolved in version 4.3.5a
19+
- cve: CVE-2025-69493
20+
reason: Resolved in version 4.3.5a
21+
- cve: CVE-2025-69494
22+
reason: Resolved in version 4.3.5a
23+
- cve: CVE-2025-69495
24+
reason: Resolved in version 4.3.5a
25+
- cve: CVE-2025-69496
26+
reason: Resolved in version 4.3.5a
27+
- cve: CVE-2025-69497
28+
reason: Resolved in version 4.3.5a
29+
- cve: CVE-2025-69498
30+
reason: Resolved in version 4.3.5a
31+
- cve: CVE-2025-69499
32+
reason: Resolved in version 4.3.5a
33+
- cve: CVE-2025-69500
34+
reason: Resolved in version 4.3.5a
35+
- cve: CVE-2025-69501
36+
reason: Resolved in version 4.3.5a

0 commit comments

Comments
 (0)