Add a compatibility EVP_DigestFinalXOF function.

This is to ease compiling against cryptography.io. (It expects anything
which has EVP_DigestSign to also have this function.)

Change-Id: I2bb4f4f01770d789e68fe84beed3393b1f004081
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/35805
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2019-04-27 13:43:06 -05:00 committed by Adam Langley
parent e79cc432e3
commit b96d470865
2 changed files with 10 additions and 0 deletions

View File

@ -115,6 +115,11 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) {
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) { EVP_MD_CTX_free(ctx); }
int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, uint8_t *out, size_t len) {
OPENSSL_PUT_ERROR(DIGEST, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) {
// |in->digest| may be NULL if this is a signing |EVP_MD_CTX| for, e.g.,
// Ed25519 which does not hash with |EVP_MD_CTX|.

View File

@ -269,6 +269,11 @@ OPENSSL_EXPORT EVP_MD_CTX *EVP_MD_CTX_create(void);
// EVP_MD_CTX_destroy calls |EVP_MD_CTX_free|.
OPENSSL_EXPORT void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
// EVP_DigestFinalXOF returns zero and adds an error to the error queue.
// BoringSSL does not support any XOF digests.
OPENSSL_EXPORT int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, uint8_t *out,
size_t len);
struct evp_md_pctx_ops;