m_null.c 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 1995-2016 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. init,
  33. update,
  34. final,
  35. NULL,
  36. NULL,
  37. 0,
  38. sizeof(EVP_MD *),
  39. };
  40. const EVP_MD *EVP_md_null(void)
  41. {
  42. return &null_md;
  43. }