Add some OpenSSL compatibility aliases.

EVP_MD_nid, in OpenSSL, is the same as EVP_MD_type. EVP_MD_type seems to
be the preferred spelling, so put EVP_MD_nid in the deprecated bucket.
Also add an EVP_MD_do_all alias to EVP_MD_do_all_sorted.

Change-Id: I4e7b800902459ac5cb9ef0df65d73da94afdf927
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/48365
Reviewed-by: Adam Langley <agl@google.com>
grpc-202302
David Benjamin 4 years ago committed by Adam Langley
parent 170045f490
commit ae7c178689
  1. 2
      crypto/fipsmodule/digest/digest.c
  2. 6
      decrepit/evp/evp_do_all.c
  3. 3
      include/openssl/digest.h
  4. 6
      include/openssl/evp.h

@ -68,6 +68,8 @@
int EVP_MD_type(const EVP_MD *md) { return md->type; }
int EVP_MD_nid(const EVP_MD *md) { return EVP_MD_type(md); }
uint32_t EVP_MD_flags(const EVP_MD *md) { return md->flags; }
size_t EVP_MD_size(const EVP_MD *md) { return md->md_size; }

@ -87,3 +87,9 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
callback(EVP_sha384(), "sha384", NULL, arg);
callback(EVP_sha512(), "sha512", NULL, arg);
}
void EVP_MD_do_all(void (*callback)(const EVP_MD *cipher, const char *name,
const char *unused, void *arg),
void *arg) {
EVP_MD_do_all_sorted(callback, arg);
}

@ -297,6 +297,9 @@ OPENSSL_EXPORT void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
// their needs). Thus this exists only to allow code to compile.
#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0
// EVP_MD_nid calls |EVP_MD_type|.
OPENSSL_EXPORT int EVP_MD_nid(const EVP_MD *md);
struct evp_md_pctx_ops;

@ -867,6 +867,12 @@ OPENSSL_EXPORT void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
void *arg),
void *arg);
OPENSSL_EXPORT void EVP_MD_do_all(void (*callback)(const EVP_MD *cipher,
const char *name,
const char *unused,
void *arg),
void *arg);
// i2d_PrivateKey marshals a private key from |key| to an ASN.1, DER
// structure. If |outp| is not NULL then the result is written to |*outp| and
// |*outp| is advanced just past the output. It returns the number of bytes in

Loading…
Cancel
Save