1e1051a39Sopenharmony_ci/* 2e1051a39Sopenharmony_ci * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. 3e1051a39Sopenharmony_ci * 4e1051a39Sopenharmony_ci * Licensed under the Apache License 2.0 (the "License"). You may not use 5e1051a39Sopenharmony_ci * this file except in compliance with the License. You can obtain a copy 6e1051a39Sopenharmony_ci * in the file LICENSE in the source distribution or at 7e1051a39Sopenharmony_ci * https://www.openssl.org/source/license.html 8e1051a39Sopenharmony_ci */ 9e1051a39Sopenharmony_ci 10e1051a39Sopenharmony_ci/* We need to use the low level ASN1 items until they are removed */ 11e1051a39Sopenharmony_ci#define OPENSSL_SUPPRESS_DEPRECATED 12e1051a39Sopenharmony_ci 13e1051a39Sopenharmony_ci#include <stdio.h> 14e1051a39Sopenharmony_ci#include "internal/cryptlib.h" 15e1051a39Sopenharmony_ci#include <openssl/asn1.h> 16e1051a39Sopenharmony_ci#include <openssl/asn1t.h> 17e1051a39Sopenharmony_ci#include <openssl/cms.h> 18e1051a39Sopenharmony_ci#include <openssl/dh.h> 19e1051a39Sopenharmony_ci#include <openssl/ocsp.h> 20e1051a39Sopenharmony_ci#include <openssl/pkcs7.h> 21e1051a39Sopenharmony_ci#include <openssl/pkcs12.h> 22e1051a39Sopenharmony_ci#include <openssl/rsa.h> 23e1051a39Sopenharmony_ci#include <openssl/x509v3.h> 24e1051a39Sopenharmony_ci 25e1051a39Sopenharmony_ci#include "asn1_item_list.h" 26e1051a39Sopenharmony_ci 27e1051a39Sopenharmony_ciconst ASN1_ITEM *ASN1_ITEM_lookup(const char *name) 28e1051a39Sopenharmony_ci{ 29e1051a39Sopenharmony_ci size_t i; 30e1051a39Sopenharmony_ci 31e1051a39Sopenharmony_ci for (i = 0; i < OSSL_NELEM(asn1_item_list); i++) { 32e1051a39Sopenharmony_ci const ASN1_ITEM *it = ASN1_ITEM_ptr(asn1_item_list[i]); 33e1051a39Sopenharmony_ci 34e1051a39Sopenharmony_ci if (strcmp(it->sname, name) == 0) 35e1051a39Sopenharmony_ci return it; 36e1051a39Sopenharmony_ci } 37e1051a39Sopenharmony_ci return NULL; 38e1051a39Sopenharmony_ci} 39e1051a39Sopenharmony_ci 40e1051a39Sopenharmony_ciconst ASN1_ITEM *ASN1_ITEM_get(size_t i) 41e1051a39Sopenharmony_ci{ 42e1051a39Sopenharmony_ci if (i >= OSSL_NELEM(asn1_item_list)) 43e1051a39Sopenharmony_ci return NULL; 44e1051a39Sopenharmony_ci return ASN1_ITEM_ptr(asn1_item_list[i]); 45e1051a39Sopenharmony_ci} 46