Place HKDF info in to a temporary buffer if required.
authorKevin Jones <kevin@vcsjones.com>
Tue, 4 May 2021 16:11:49 +0000 (12:11 -0400)
committerGitHub <noreply@github.com>
Tue, 4 May 2021 16:11:49 +0000 (09:11 -0700)
commita24f32383cd4055ccf8e8cfe5bbdc314b271c6d4
tree24d49aaa558b5baea58129af66d31efcd969a8c7
parentfb931c6fa65470899f811f8102523cf320ee7a50
Place HKDF info in to a temporary buffer if required.

If the info input overlaps with the output destination, copy
the info to a temporary buffer first. As the HKDF expansion
is performed, the output buffer is filled by hash size. However
this will overwrite the info, should the buffers overlap.

The other parameters, like prk, salt, and ikm do not need any addional
handling for overlaps.
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HKDF.cs
src/libraries/System.Security.Cryptography.Algorithms/tests/HKDFTests.cs