2
0

Type key is K, subkey context is not bound by BYTES_MIN/MAX.

This commit is contained in:
Maarten Billemont 2017-09-14 23:03:39 -04:00
parent fa6133200e
commit e3a7ea57e0
2 changed files with 1 additions and 2 deletions

View File

@ -46,7 +46,7 @@ const MPResultType mpw_typeWithName(const char *typeName) {
return MPResultTypeStatefulPersonal;
if ('D' == typeName[0])
return MPResultTypeStatefulDevice;
if ('k' == typeName[0])
if ('K' == typeName[0])
return MPResultTypeDeriveKey;
}

View File

@ -207,7 +207,6 @@ uint8_t const *mpw_kdf_blake2b(const size_t subkeySize, const uint8_t *key, cons
#if MPW_SODIUM
if (keySize < crypto_generichash_blake2b_KEYBYTES_MIN || keySize > crypto_generichash_blake2b_KEYBYTES_MAX ||
subkeySize < crypto_generichash_blake2b_KEYBYTES_MIN || subkeySize > crypto_generichash_blake2b_KEYBYTES_MAX ||
contextSize < crypto_generichash_blake2b_BYTES_MIN || contextSize > crypto_generichash_blake2b_BYTES_MAX ||
(personal && strlen( personal ) > crypto_generichash_blake2b_PERSONALBYTES)) {
errno = EINVAL;
free( subkey );