[libfko] ensure a NULL HMAC key is properly handled
This commit is contained in:
@@ -48,6 +48,9 @@ fko_verify_hmac(fko_ctx_t ctx,
|
||||
if(!CTX_INITIALIZED(ctx))
|
||||
return(FKO_ERROR_CTX_NOT_INITIALIZED);
|
||||
|
||||
if(hmac_key == NULL)
|
||||
return(FKO_ERROR_INVALID_DATA);
|
||||
|
||||
if (! is_valid_encoded_msg_len(ctx->encrypted_msg_len))
|
||||
return(FKO_ERROR_INVALID_DATA_HMAC_MSGLEN_VALIDFAIL);
|
||||
|
||||
@@ -230,6 +233,9 @@ int fko_set_spa_hmac(fko_ctx_t ctx,
|
||||
if(!CTX_INITIALIZED(ctx))
|
||||
return(FKO_ERROR_CTX_NOT_INITIALIZED);
|
||||
|
||||
if(hmac_key == NULL)
|
||||
return(FKO_ERROR_INVALID_DATA);
|
||||
|
||||
if(hmac_key_len < 0 || hmac_key_len > MAX_DIGEST_BLOCK_LEN)
|
||||
return(FKO_ERROR_INVALID_HMAC_KEY_LEN);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user