EVP_Digest*Update, EVP_DigestFinal, and HMAC_Update can never fail. Enough code fails to check their return codes anyway. We ought to make it official. Change-Id: Ie646360fd7073ea943036f5e21bed13df7e1b77a Reviewed-on: https://boringssl-review.googlesource.com/4954 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/digest.h b/include/openssl/digest.h index 8285dce..a7123cc 100644 --- a/include/openssl/digest.h +++ b/include/openssl/digest.h
@@ -134,7 +134,7 @@ OPENSSL_EXPORT int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); /* EVP_DigestUpdate hashes |len| bytes from |data| into the hashing operation - * in |ctx|. It returns one on success and zero otherwise. */ + * in |ctx|. It returns one. */ OPENSSL_EXPORT int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t len); @@ -144,10 +144,9 @@ /* EVP_DigestFinal_ex finishes the digest in |ctx| and writes the output to * |md_out|. At most |EVP_MAX_MD_SIZE| bytes are written. If |out_size| is not - * NULL then |*out_size| is set to the number of bytes written. It returns one - * on success and zero otherwise. After this call, the hash cannot be updated - * or finished again until |EVP_DigestInit_ex| is called to start another - * hashing operation. */ + * NULL then |*out_size| is set to the number of bytes written. It returns one. + * After this call, the hash cannot be updated or finished again until + * |EVP_DigestInit_ex| is called to start another hashing operation. */ OPENSSL_EXPORT int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, uint8_t *md_out, unsigned int *out_size); @@ -251,7 +250,7 @@ /* update is usually copied from |digest->update| but can differ in some * cases, i.e. HMAC. * TODO(davidben): Remove this hook once |EVP_PKEY_HMAC| is gone. */ - int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count); + void (*update)(EVP_MD_CTX *ctx, const void *data, size_t count); /* pctx is an opaque (at this layer) pointer to additional context that * EVP_PKEY functions may store in this object. */
diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 28ae987..490a951 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h
@@ -241,8 +241,7 @@ EVP_PKEY *pkey); /* EVP_DigestSignUpdate appends |len| bytes from |data| to the data which will - * be signed in |EVP_DigestSignFinal|. It returns one on success and zero - * otherwise. */ + * be signed in |EVP_DigestSignFinal|. It returns one. */ OPENSSL_EXPORT int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t len); @@ -293,8 +292,7 @@ EVP_PKEY *pkey); /* EVP_DigestVerifyUpdate appends |len| bytes from |data| to the data which - * will be verified by |EVP_DigestVerifyFinal|. It returns one on success and - * zero otherwise. */ + * will be verified by |EVP_DigestVerifyFinal|. It returns one. */ OPENSSL_EXPORT int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t len);
diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h index 89cdf8f..b8cf4af 100644 --- a/include/openssl/hmac.h +++ b/include/openssl/hmac.h
@@ -106,7 +106,7 @@ const EVP_MD *md, ENGINE *impl); /* HMAC_Update hashes |data_len| bytes from |data| into the current HMAC - * operation in |ctx|. It returns one on success and zero on error. */ + * operation in |ctx|. It returns one. */ OPENSSL_EXPORT int HMAC_Update(HMAC_CTX *ctx, const uint8_t *data, size_t data_len);