Check for overlows and error return from ASN1_object_size()
[openssl.git] / crypto / asn1 / x_spki.c
1 /*
2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
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
8  */
9
10  /*
11   * This module was send to me my Pat Richards <patr@x509.com> who wrote it.
12   * It is under my Copyright with his permission
13   */
14
15 #include <stdio.h>
16 #include "internal/cryptlib.h"
17 #include <openssl/x509.h>
18 #include <openssl/asn1t.h>
19
20 ASN1_SEQUENCE(NETSCAPE_SPKAC) = {
21         ASN1_SIMPLE(NETSCAPE_SPKAC, pubkey, X509_PUBKEY),
22         ASN1_SIMPLE(NETSCAPE_SPKAC, challenge, ASN1_IA5STRING)
23 } ASN1_SEQUENCE_END(NETSCAPE_SPKAC)
24
25 IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
26
27 ASN1_SEQUENCE(NETSCAPE_SPKI) = {
28         ASN1_SIMPLE(NETSCAPE_SPKI, spkac, NETSCAPE_SPKAC),
29         ASN1_EMBED(NETSCAPE_SPKI, sig_algor, X509_ALGOR),
30         ASN1_SIMPLE(NETSCAPE_SPKI, signature, ASN1_BIT_STRING)
31 } ASN1_SEQUENCE_END(NETSCAPE_SPKI)
32
33 IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKI)