ocsp_asn.c (1.1.1.2) | ocsp_asn.c (1.1.1.3) |
---|---|
1/* ocsp_asn.c */ | |
2/* | 1/* |
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project 4 * 2000. 5 */ 6/* ==================================================================== 7 * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | 2 * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. |
8 * | 3 * |
9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in 18 * the documentation and/or other materials provided with the 19 * distribution. 20 * 21 * 3. All advertising materials mentioning features or use of this 22 * software must display the following acknowledgment: 23 * "This product includes software developed by the OpenSSL Project 24 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 * 26 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 * endorse or promote products derived from this software without 28 * prior written permission. For written permission, please contact 29 * licensing@OpenSSL.org. 30 * 31 * 5. Products derived from this software may not be called "OpenSSL" 32 * nor may "OpenSSL" appear in their names without prior written 33 * permission of the OpenSSL Project. 34 * 35 * 6. Redistributions of any form whatsoever must retain the following 36 * acknowledgment: 37 * "This product includes software developed by the OpenSSL Project 38 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 * 40 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 * OF THE POSSIBILITY OF SUCH DAMAGE. 52 * ==================================================================== 53 * 54 * This product includes cryptographic software written by Eric Young 55 * (eay@cryptsoft.com). This product includes software written by Tim 56 * Hudson (tjh@cryptsoft.com). 57 * | 4 * Licensed under the OpenSSL license (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 |
58 */ | 8 */ |
9 |
|
59#include <openssl/asn1.h> 60#include <openssl/asn1t.h> 61#include <openssl/ocsp.h> | 10#include <openssl/asn1.h> 11#include <openssl/asn1t.h> 12#include <openssl/ocsp.h> |
13#include "ocsp_lcl.h" |
|
62 63ASN1_SEQUENCE(OCSP_SIGNATURE) = { | 14 15ASN1_SEQUENCE(OCSP_SIGNATURE) = { |
64 ASN1_SIMPLE(OCSP_SIGNATURE, signatureAlgorithm, X509_ALGOR), | 16 ASN1_EMBED(OCSP_SIGNATURE, signatureAlgorithm, X509_ALGOR), |
65 ASN1_SIMPLE(OCSP_SIGNATURE, signature, ASN1_BIT_STRING), 66 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_SIGNATURE, certs, X509, 0) 67} ASN1_SEQUENCE_END(OCSP_SIGNATURE) 68 69IMPLEMENT_ASN1_FUNCTIONS(OCSP_SIGNATURE) 70 71ASN1_SEQUENCE(OCSP_CERTID) = { | 17 ASN1_SIMPLE(OCSP_SIGNATURE, signature, ASN1_BIT_STRING), 18 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_SIGNATURE, certs, X509, 0) 19} ASN1_SEQUENCE_END(OCSP_SIGNATURE) 20 21IMPLEMENT_ASN1_FUNCTIONS(OCSP_SIGNATURE) 22 23ASN1_SEQUENCE(OCSP_CERTID) = { |
72 ASN1_SIMPLE(OCSP_CERTID, hashAlgorithm, X509_ALGOR), 73 ASN1_SIMPLE(OCSP_CERTID, issuerNameHash, ASN1_OCTET_STRING), 74 ASN1_SIMPLE(OCSP_CERTID, issuerKeyHash, ASN1_OCTET_STRING), 75 ASN1_SIMPLE(OCSP_CERTID, serialNumber, ASN1_INTEGER) | 24 ASN1_EMBED(OCSP_CERTID, hashAlgorithm, X509_ALGOR), 25 ASN1_EMBED(OCSP_CERTID, issuerNameHash, ASN1_OCTET_STRING), 26 ASN1_EMBED(OCSP_CERTID, issuerKeyHash, ASN1_OCTET_STRING), 27 ASN1_EMBED(OCSP_CERTID, serialNumber, ASN1_INTEGER) |
76} ASN1_SEQUENCE_END(OCSP_CERTID) 77 78IMPLEMENT_ASN1_FUNCTIONS(OCSP_CERTID) 79 80ASN1_SEQUENCE(OCSP_ONEREQ) = { 81 ASN1_SIMPLE(OCSP_ONEREQ, reqCert, OCSP_CERTID), 82 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_ONEREQ, singleRequestExtensions, X509_EXTENSION, 0) 83} ASN1_SEQUENCE_END(OCSP_ONEREQ) --- 5 unchanged lines hidden (view full) --- 89 ASN1_EXP_OPT(OCSP_REQINFO, requestorName, GENERAL_NAME, 1), 90 ASN1_SEQUENCE_OF(OCSP_REQINFO, requestList, OCSP_ONEREQ), 91 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_REQINFO, requestExtensions, X509_EXTENSION, 2) 92} ASN1_SEQUENCE_END(OCSP_REQINFO) 93 94IMPLEMENT_ASN1_FUNCTIONS(OCSP_REQINFO) 95 96ASN1_SEQUENCE(OCSP_REQUEST) = { | 28} ASN1_SEQUENCE_END(OCSP_CERTID) 29 30IMPLEMENT_ASN1_FUNCTIONS(OCSP_CERTID) 31 32ASN1_SEQUENCE(OCSP_ONEREQ) = { 33 ASN1_SIMPLE(OCSP_ONEREQ, reqCert, OCSP_CERTID), 34 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_ONEREQ, singleRequestExtensions, X509_EXTENSION, 0) 35} ASN1_SEQUENCE_END(OCSP_ONEREQ) --- 5 unchanged lines hidden (view full) --- 41 ASN1_EXP_OPT(OCSP_REQINFO, requestorName, GENERAL_NAME, 1), 42 ASN1_SEQUENCE_OF(OCSP_REQINFO, requestList, OCSP_ONEREQ), 43 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_REQINFO, requestExtensions, X509_EXTENSION, 2) 44} ASN1_SEQUENCE_END(OCSP_REQINFO) 45 46IMPLEMENT_ASN1_FUNCTIONS(OCSP_REQINFO) 47 48ASN1_SEQUENCE(OCSP_REQUEST) = { |
97 ASN1_SIMPLE(OCSP_REQUEST, tbsRequest, OCSP_REQINFO), | 49 ASN1_EMBED(OCSP_REQUEST, tbsRequest, OCSP_REQINFO), |
98 ASN1_EXP_OPT(OCSP_REQUEST, optionalSignature, OCSP_SIGNATURE, 0) 99} ASN1_SEQUENCE_END(OCSP_REQUEST) 100 101IMPLEMENT_ASN1_FUNCTIONS(OCSP_REQUEST) 102 103/* OCSP_RESPONSE templates */ 104 105ASN1_SEQUENCE(OCSP_RESPBYTES) = { --- 39 unchanged lines hidden (view full) --- 145 ASN1_EXP_OPT(OCSP_SINGLERESP, nextUpdate, ASN1_GENERALIZEDTIME, 0), 146 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_SINGLERESP, singleExtensions, X509_EXTENSION, 1) 147} ASN1_SEQUENCE_END(OCSP_SINGLERESP) 148 149IMPLEMENT_ASN1_FUNCTIONS(OCSP_SINGLERESP) 150 151ASN1_SEQUENCE(OCSP_RESPDATA) = { 152 ASN1_EXP_OPT(OCSP_RESPDATA, version, ASN1_INTEGER, 0), | 50 ASN1_EXP_OPT(OCSP_REQUEST, optionalSignature, OCSP_SIGNATURE, 0) 51} ASN1_SEQUENCE_END(OCSP_REQUEST) 52 53IMPLEMENT_ASN1_FUNCTIONS(OCSP_REQUEST) 54 55/* OCSP_RESPONSE templates */ 56 57ASN1_SEQUENCE(OCSP_RESPBYTES) = { --- 39 unchanged lines hidden (view full) --- 97 ASN1_EXP_OPT(OCSP_SINGLERESP, nextUpdate, ASN1_GENERALIZEDTIME, 0), 98 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_SINGLERESP, singleExtensions, X509_EXTENSION, 1) 99} ASN1_SEQUENCE_END(OCSP_SINGLERESP) 100 101IMPLEMENT_ASN1_FUNCTIONS(OCSP_SINGLERESP) 102 103ASN1_SEQUENCE(OCSP_RESPDATA) = { 104 ASN1_EXP_OPT(OCSP_RESPDATA, version, ASN1_INTEGER, 0), |
153 ASN1_SIMPLE(OCSP_RESPDATA, responderId, OCSP_RESPID), | 105 ASN1_EMBED(OCSP_RESPDATA, responderId, OCSP_RESPID), |
154 ASN1_SIMPLE(OCSP_RESPDATA, producedAt, ASN1_GENERALIZEDTIME), 155 ASN1_SEQUENCE_OF(OCSP_RESPDATA, responses, OCSP_SINGLERESP), 156 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_RESPDATA, responseExtensions, X509_EXTENSION, 1) 157} ASN1_SEQUENCE_END(OCSP_RESPDATA) 158 159IMPLEMENT_ASN1_FUNCTIONS(OCSP_RESPDATA) 160 161ASN1_SEQUENCE(OCSP_BASICRESP) = { | 106 ASN1_SIMPLE(OCSP_RESPDATA, producedAt, ASN1_GENERALIZEDTIME), 107 ASN1_SEQUENCE_OF(OCSP_RESPDATA, responses, OCSP_SINGLERESP), 108 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_RESPDATA, responseExtensions, X509_EXTENSION, 1) 109} ASN1_SEQUENCE_END(OCSP_RESPDATA) 110 111IMPLEMENT_ASN1_FUNCTIONS(OCSP_RESPDATA) 112 113ASN1_SEQUENCE(OCSP_BASICRESP) = { |
162 ASN1_SIMPLE(OCSP_BASICRESP, tbsResponseData, OCSP_RESPDATA), 163 ASN1_SIMPLE(OCSP_BASICRESP, signatureAlgorithm, X509_ALGOR), | 114 ASN1_EMBED(OCSP_BASICRESP, tbsResponseData, OCSP_RESPDATA), 115 ASN1_EMBED(OCSP_BASICRESP, signatureAlgorithm, X509_ALGOR), |
164 ASN1_SIMPLE(OCSP_BASICRESP, signature, ASN1_BIT_STRING), 165 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_BASICRESP, certs, X509, 0) 166} ASN1_SEQUENCE_END(OCSP_BASICRESP) 167 168IMPLEMENT_ASN1_FUNCTIONS(OCSP_BASICRESP) 169 170ASN1_SEQUENCE(OCSP_CRLID) = { 171 ASN1_EXP_OPT(OCSP_CRLID, crlUrl, ASN1_IA5STRING, 0), --- 12 unchanged lines hidden --- | 116 ASN1_SIMPLE(OCSP_BASICRESP, signature, ASN1_BIT_STRING), 117 ASN1_EXP_SEQUENCE_OF_OPT(OCSP_BASICRESP, certs, X509, 0) 118} ASN1_SEQUENCE_END(OCSP_BASICRESP) 119 120IMPLEMENT_ASN1_FUNCTIONS(OCSP_BASICRESP) 121 122ASN1_SEQUENCE(OCSP_CRLID) = { 123 ASN1_EXP_OPT(OCSP_CRLID, crlUrl, ASN1_IA5STRING, 0), --- 12 unchanged lines hidden --- |