<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netxduo.git/crypto_libraries/src/nx_crypto_drbg.c, branch dev</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/netxduo.git/atom/crypto_libraries/src/nx_crypto_drbg.c?h=dev</id>
<link rel='self' href='http://cgit.235523.xyz/netxduo.git/atom/crypto_libraries/src/nx_crypto_drbg.c?h=dev'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/'/>
<updated>2026-08-13T14:06:44Z</updated>
<entry>
<title>Released the DRBG mutex when _nx_crypto_drbg_generate fails (#412)</title>
<updated>2026-08-13T14:06:44Z</updated>
<author>
<name>Edouard Malot</name>
<email>edouard.malot@gmail.com</email>
</author>
<published>2026-08-13T14:06:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=1e1d8c1a184edee76575bdb23dda040ea1c4a8a7'/>
<id>urn:sha1:1e1d8c1a184edee76575bdb23dda040ea1c4a8a7</id>
<content type='text'>
Released the DRBG mutex when generation fails

_nx_crypto_drbg() acquired NX_CRYPTO_DRBG_MUTEX_GET, called
_nx_crypto_drbg_generate(), and then returned on a non-zero status from above
the matching NX_CRYPTO_DRBG_MUTEX_PUT. That return abandoned the mutex. It is
the only acquire/release pair in the file, so there is no second imbalance and
no compensating release elsewhere: once that path is taken the mutex is held
for good.

Move the release above the status check rather than adding a second release on
the error path, which would leave two call sites to keep in step. The bit
masking that follows stays outside the critical section, which is safe: it reads
bits, computes mask and writes result[0], all of it local or caller owned, with
no DRBG state involved.

The failure this fixes is the only one this caller can produce, not an obscure
one. _nx_crypto_drbg_generate() has three failure returns. Two are
NX_CRYPTO_SIZE_ERROR conditions on additional_input_len, and _nx_crypto_drbg()
passes NX_CRYPTO_NULL and 0 for those arguments, so neither is reachable from
here. The third is NX_CRYPTO_NO_INSTANCE when nx_crypto_drbg_instantiated is
false, and that flag is false in exactly one circumstance: the
_nx_crypto_drbg_initialize() call on the line above failed and its return value
was discarded. So the abandoned mutex sits on the one error this function can
actually return.

That also disposes of the discarded initialisation return as a separate concern.
With the release moved, an initialisation failure now propagates
NX_CRYPTO_NO_INSTANCE to the caller with the mutex released, which is the
correct behaviour; checking the return explicitly would change nothing
observable.

How reachable this is depends on the port. Both macros default to empty under
#ifndef in nx_crypto_drbg.h, and nothing in the repository defines them, so no
configuration built here observes the leak. A port that supplies real ones does.
In NX_CRYPTO_SELF_TEST builds NX_CRYPTO_RBG resolves to _nx_crypto_drbg
(nx_crypto.h), so on such a port this deadlocks the generator behind EC key
generation and ECDSA signing, which reach it through NX_CRYPTO_RBG in
nx_crypto_ec.c. That is the random number generator for the whole FIPS
configuration rather than a peripheral path.

No regression test accompanies this. There is no configuration the project
builds in which the change is observable, since both mutex macros expand to
nothing everywhere in tree, so a test could only assert that empty macros remain
empty.

Two points worth knowing about it:

The reachability paragraph is the part that earns its place. Without it the change reads as defensive tidying of a rare error path; with it, the leak sits on the only failure this caller can produce, and the thing producing it is the unchecked call immediately above. That's also why the discarded _nx_crypto_drbg_initialize() return needs no separate fix — worth stating, since it's the obvious follow-up question a reviewer would raise.

I verified every reference against the code rather than reusing the review's numbers: the acquire and release are the file's only pair (lines 1169 and 1178 after the fix), the macros default empty at nx_crypto_drbg.h:79-85, NX_CRYPTO_RBG aliases _nx_crypto_drbg inside the NX_CRYPTO_SELF_TEST branch of nx_crypto.h, and the EC callers are nx_crypto_ec.c:2945 and :4671. I left bare line numbers out of the message itself — they rot, and the identifiers locate everything unambiguously.</content>
</entry>
<entry>
<title>Updated copyright headers and version strings. Removed version history</title>
<updated>2026-03-06T23:14:18Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-03-06T23:14:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=ff90b3ffcb84b2c6099ec31ef032b541e1ef5f0a'/>
<id>urn:sha1:ff90b3ffcb84b2c6099ec31ef032b541e1ef5f0a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Updated version numbers to 6.4.3</title>
<updated>2025-03-18T14:24:08Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2025-03-18T14:24:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=c82ea77c4bf3a3e25b6f622e59465998f8c6e738'/>
<id>urn:sha1:c82ea77c4bf3a3e25b6f622e59465998f8c6e738</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update copyright.</title>
<updated>2024-01-29T03:03:49Z</updated>
<author>
<name>Bo Chen (from Dev Box)</name>
<email>boche@microsoft.com</email>
</author>
<published>2024-01-29T03:03:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=6c6e58cb977dd1c08d2d344624e7d30d15d48d35'/>
<id>urn:sha1:6c6e58cb977dd1c08d2d344624e7d30d15d48d35</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update on 23 Oct 2023. Expand to see details.</title>
<updated>2023-10-23T05:28:48Z</updated>
<author>
<name>Tiejun Zhou</name>
<email>tizho@microsoft.com</email>
</author>
<published>2023-10-23T05:28:48Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=837b032b9c773ea32f78dfa6339a76f2df3568fb'/>
<id>urn:sha1:837b032b9c773ea32f78dfa6339a76f2df3568fb</id>
<content type='text'>
002a5890e Generated rtxp demo in netxduo/samples folder.
c09d9da51 Add function header in .h for RTP and RTSP
f5a96f35b Update function header and version for 6.3.0
0ff7a6809 Correct dhcpv6 server for ignoring lifetime fields in client request
9a2129c35 Fixed dhcpv6 server not update client record issue
e59d2b5f1 Fix dhcp coverage test compile wanrning
d00655d71 Fix infinite loop issue in TCP &amp; UDP free port find function
c194c74ca Optimize rtp_sender and fix pipeline reported issues
b6df8dea0 Add RTxP feature
38e57e633 Added test case for _nx_snmp_utility_object_id_get().
321c88bd9 Added check for pdu length.
36ffb7c39 Fixed packet double release.
92166d736 Fixed SNMP test cases for v4_small_build
67f071552 Improved buffer length verification for padding.
30cc5d8b2 Fix wait option used in FTP test case
098a97213 Avoid duplicate packet release when DTLS send fails
15313e868 Improved buffer length verification for _nx_snmp_utility_object_id_set().
ecd3904d3 Fixed MSRC 81018
caa004007 Fix the logic of handling close notify packet from peer
2b8c87685 Removed main.c into netxduo/samples folder, then all addons can use it.
c72c66cdc Fixed MSARC 81019 and MSRC 81079
8169be7a6 Fixed MSRC81005 and MSRC81020
41389b76b Fixed packet double release issue in _nx_ftp_client_file_write
19348e408 Combined the functions of processing snmp v1 and v2.
9174b6457 Fixed icmpv6 ra buffer overwrite test case.
6bdc703d9 Fixed packet double release issue in _nx_nat_process_packet
403ecd128 Set nx_smtp_server_packet to NULL to avoided duplicate packet release in _nx_smtp_utility_read_server_code
af5dd00c6 Disable FTP server MSS test case when packet chain is disabled
beadbce12 Enable weekly pipeline build to avoid CodeQL expiration
5a3d88f97 Fixed MSRC 81528
df6a1fc57 unify the code.
18c13bfdb Fixed MSRC 80745.
2cce43f48 Fixed bug in utility/iperf/nx_iperf.c pointer used before set its value.
2477fb81c Update product owners
2f5734ada Fixed MSRC 80686
34e713e26 Fixed data length underflow when TCP MSS is less than 255
7097a7859 Improved the test cases for packet chain.
1ffa13cfa Fixed MSRC 80685
97e2b8d8e Set packet pointer to NULL after released to fix duplicate packet release issue
c1e47efa7 Fix ICMPv6 NS buffer overwrite issue.
c2770ea68 Add ICMPv6 NA buffer overwrite test case.
36bb05f85 Validated TCP header buffer to avoid span in multiple packets
84070bb2a Correct the length of packet buffer to avoid write overflow
5b3b3a10b Dropped packet chain for SNTP data to avoid write overflow
82699872d Onebranch build Image Update: Move pipelines to supported and compliant OneBranch container images
a30171f93 Add a test case to demonstrate IGMP override caused by IP assembly.
72472ff4b Fix MSRC 80746
5d9f1266a Corrected the acked packet count when out of order is enabled
b113ebdc9 Fixed DHCP server local variable type issue
b70863299 Enable codeql in onebranch pipeline
</content>
</entry>
<entry>
<title>Update on 30 Jun 2023. Expand to see details.</title>
<updated>2023-06-30T02:11:06Z</updated>
<author>
<name>Tiejun Zhou</name>
<email>tizho@microsoft.com</email>
</author>
<published>2023-06-30T02:11:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=4d71251e4d122b1f7f8fb2ee91b27653e4b39ce2'/>
<id>urn:sha1:4d71251e4d122b1f7f8fb2ee91b27653e4b39ce2</id>
<content type='text'>
06cb10f01 Fix typo in NetXDuo Crypto
996dd14fc BSD functions overriding option
3b756c219 Fix mqtt interoperability issue when upgrade to ubuntu 20.04
01ca51021 Added support for skipping failed step
3e3a15e79 Add record length checking in nxe_secure_tls_session_send.
ec617d178 Fix demo_netx_secure_tls test link issue under nightly build
a934cb718 Fix pipeline libgcc issue in nx_secure_interoperability test
f08024578 Fix illegal access when NXD_MQTT_OVER_WEBSOCKET enabled
9798e2b89 Corrected the mDNS symbols check
456007dd1 Fixed multiple proxy update issue
cf0bf15b5 Add TLS sample demo_netx_secure_tls.c.
87ea505bf Add sha256 in driver preprocess command for ADU
7e1b9686a Add pnp check for ADU
ef78d336d Improved the code to ignore null file url.
</content>
</entry>
<entry>
<title>6.1 Release</title>
<updated>2020-10-09T19:34:01Z</updated>
<author>
<name>Scott Larson</name>
<email>sclarson@microsoft.com</email>
</author>
<published>2020-10-09T19:34:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=c61953bcd21bb3d5e233168eb16441eba7ba9afd'/>
<id>urn:sha1:c61953bcd21bb3d5e233168eb16441eba7ba9afd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>updated to 6.0.1 and added additional processors/toolchains</title>
<updated>2020-07-13T20:31:50Z</updated>
<author>
<name>Scott Larson</name>
<email>sclarson@microsoft.com</email>
</author>
<published>2020-07-13T20:31:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=b71efef0391ae1ed7837af0a2292a3b1f848aafb'/>
<id>urn:sha1:b71efef0391ae1ed7837af0a2292a3b1f848aafb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Initial commit</title>
<updated>2020-05-11T14:54:23Z</updated>
<author>
<name>PProvost</name>
<email>peter@provost.org</email>
</author>
<published>2020-05-11T14:54:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=0c4f784459a7564933ed91bf39f00d12608cf91c'/>
<id>urn:sha1:0c4f784459a7564933ed91bf39f00d12608cf91c</id>
<content type='text'>
</content>
</entry>
</feed>
