2
0

asn1_item_list.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2000-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/asn1.h>
  12. #include <openssl/asn1t.h>
  13. #include <openssl/cms.h>
  14. #include <openssl/dh.h>
  15. #include <openssl/ocsp.h>
  16. #include <openssl/pkcs7.h>
  17. #include <openssl/pkcs12.h>
  18. #include <openssl/rsa.h>
  19. #include <openssl/x509v3.h>
  20. #include "asn1_item_list.h"
  21. const ASN1_ITEM *ASN1_ITEM_lookup(const char *name)
  22. {
  23. size_t i;
  24. for (i = 0; i < OSSL_NELEM(asn1_item_list); i++) {
  25. const ASN1_ITEM *it = ASN1_ITEM_ptr(asn1_item_list[i]);
  26. if (strcmp(it->sname, name) == 0)
  27. return it;
  28. }
  29. return NULL;
  30. }
  31. const ASN1_ITEM *ASN1_ITEM_get(size_t i)
  32. {
  33. if (i >= OSSL_NELEM(asn1_item_list))
  34. return NULL;
  35. return ASN1_ITEM_ptr(asn1_item_list[i]);
  36. }