NCC Group reported a race condition in RegisterAlgorithm:
The registration is performed through a global map. There is no mutex protection:
concurrent accesses from several distinct threads (“goroutines”) may lead to adverse
effects, including multiple registration of an algorithm, apparent removal of an existing
registration, or a panic due to an out-of-bounds memory access
is expected to apply its own locking to ensure that no other thread may access the
library (including for merely verifying a signature) while any thread is performing a
registration; however, this aspect is entirely undocumented
NCC Group reported a race condition in
RegisterAlgorithm
:This PR fix the race condition.
@SteveLasker @shizhMSFT