m_null.c 942 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <stdio.h>
  10. #include "internal/cryptlib.h"
  11. #include <openssl/evp.h>
  12. #include <openssl/objects.h>
  13. #include <openssl/x509.h>
  14. #include "crypto/evp.h"
  15. static int init(EVP_MD_CTX *ctx)
  16. {
  17. return 1;
  18. }
  19. static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
  20. {
  21. return 1;
  22. }
  23. static int final(EVP_MD_CTX *ctx, unsigned char *md)
  24. {
  25. return 1;
  26. }
  27. static const EVP_MD null_md = {
  28. NID_undef,
  29. NID_undef,
  30. 0,
  31. 0,
  32. EVP_ORIG_GLOBAL,
  33. init,
  34. update,
  35. final,
  36. NULL,
  37. NULL,
  38. 0,
  39. sizeof(EVP_MD *),
  40. };
  41. const EVP_MD *EVP_md_null(void)
  42. {
  43. return &null_md;
  44. }