Don't check *digest_len in yaca_digest_finalize() 43/90143/3
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 28 Sep 2016 12:31:35 +0000 (14:31 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Thu, 29 Sep 2016 13:54:17 +0000 (06:54 -0700)
It's an [out] argument and value pointed by it shouldn't be checked.

Change-Id: I15e9b7c1e5e7e3de5cbaa4a4492b41b3929a0f28

src/digest.c

index 5b4b2f4..7b14ad2 100644 (file)
@@ -217,9 +217,6 @@ API int yaca_digest_finalize(yaca_context_h ctx, char *digest, size_t *digest_le
        if (!verify_state_change(c, CTX_FINALIZED))
                return YACA_ERROR_INVALID_PARAMETER;
 
-       if (*digest_len == 0 || *digest_len > UINT_MAX) /* DigestFinal accepts UINT */
-               return YACA_ERROR_INVALID_PARAMETER;
-
        ret = EVP_DigestFinal_ex(c->md_ctx, (unsigned char*)digest, &len);
        if (ret != 1) {
                ret = YACA_ERROR_INTERNAL;