This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bug in hkdf sample in ncs v1.6.0-rc2

Hi,

Spotted a mistake in the crypto/hkdf sample, on line 117 in main.c on the condition check.

	cmp_status = memcmp(m_expected_output_key, m_output_key, sizeof(m_output_key));
	if (status != 0) {
		PRINT_MESSAGE("Error, the derived key doesn't match the expected value!");
		return APP_ERROR;
	}

Guess the correct fix should be:

	cmp_status = memcmp(m_expected_output_key, m_output_key, sizeof(m_output_key));
	if (cmp_status != 0) {
		PRINT_MESSAGE("Error, the derived key doesn't match the expected value!");
		return APP_ERROR;
	}

Related