Data provided for public key cryptography operation is NULL or data length is zero
This defect occurs when the data provided for an encryption, decryption, signing, or authentication operation is NULL or the data length is zero.
For instance, you unintentionally provide a NULL value for in or a
zero value for in_len in this decryption
operation:
ret = EVP_PKEY_decrypt(ctx, out, &out_len, in, in_len);
md or sig, or a zero
value for md_len or sig_len in this verification
operation:ret = EVP_PKEY_verify(ctx, md, mdlen, sig, siglen);
With NULL data or zero length, the operation does not occur. The redundant operation often indicates a coding error.
Check the placement of the encryption, decryption, or signing operation. If the operation is intended to happen, make sure that the data provided is non-NULL. Set the data length to a nonzero value.
| Group: Cryptography |
| Language: C | C++ |
| Default: Off |
Command-Line Syntax:
CRYPTO_PKEY_NO_DATA |
| Impact: Medium |
| CWE ID: 310, 325, 372, 573 |
Context
initialized incorrectly for cryptographic operation | Find defects (-checkers) | Incorrect key for
cryptographic algorithm | Missing
parameters for key generation | Missing peer
key | Missing private
key | Missing public
key | Nonsecure
parameters for key generation