blob: 6fc6fe6f1a8bb05c3dfaa180b781d575267f8ab2 [file] [log] [blame]
Hanno Beckerf6bc8882019-05-02 13:05:58 +01001/**
2 * \file x509_internal.h
3 *
4 * \brief Internal X.509 functions
5 */
6/*
7 * Copyright (C) 2006-2019, ARM Limited, All Rights Reserved
8 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 * This file is part of Mbed TLS (https://tls.mbed.org)
23 *
24 */
25#ifndef MBEDTLS_X509_INTERNAL_H
26#define MBEDTLS_X509_INTERNAL_H
27
28#include "x509.h"
29
30int mbedtls_x509_get_name( unsigned char *p, size_t len,
31 mbedtls_x509_name *cur );
32int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end,
33 mbedtls_x509_buf *alg );
34int mbedtls_x509_get_alg( unsigned char **p, const unsigned char *end,
35 mbedtls_x509_buf *alg, mbedtls_x509_buf *params );
36#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
37int mbedtls_x509_get_rsassa_pss_params( const mbedtls_x509_buf *params,
38 mbedtls_md_type_t *md_alg, mbedtls_md_type_t *mgf_md,
39 int *salt_len );
40#endif
41int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig );
42int mbedtls_x509_get_sig_alg_raw( unsigned char **p, unsigned char const *end,
43 mbedtls_md_type_t *md_alg,
44 mbedtls_pk_type_t *pk_alg,
45 void **sig_opts );
46int mbedtls_x509_get_sig_alg( const mbedtls_x509_buf *sig_oid, const mbedtls_x509_buf *sig_params,
47 mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg,
48 void **sig_opts );
49int mbedtls_x509_get_time( unsigned char **p, const unsigned char *end,
50 mbedtls_x509_time *t );
51int mbedtls_x509_get_serial( unsigned char **p, const unsigned char *end,
52 mbedtls_x509_buf *serial );
53int mbedtls_x509_name_cmp_raw( mbedtls_x509_buf_raw const *a,
54 mbedtls_x509_buf_raw const *b,
55 int (*check)( void *ctx,
56 mbedtls_x509_buf *oid,
57 mbedtls_x509_buf *val,
58 int next_merged ),
59 void *check_ctx );
60int mbedtls_x509_memcasecmp( const void *s1, const void *s2,
61 size_t len1, size_t lend2 );
62int mbedtls_x509_get_ext( unsigned char **p, const unsigned char *end,
63 mbedtls_x509_buf *ext, int tag );
64
65#if !defined(MBEDTLS_X509_REMOVE_INFO)
66int mbedtls_x509_sig_alg_gets( char *buf, size_t size,
67 mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg,
68 const void *sig_opts );
69#endif
70int mbedtls_x509_key_size_helper( char *buf, size_t buf_size, const char *name );
71int mbedtls_x509_string_to_names( mbedtls_asn1_named_data **head, const char *name );
72int mbedtls_x509_set_extension( mbedtls_asn1_named_data **head, const char *oid, size_t oid_len,
73 int critical, const unsigned char *val,
74 size_t val_len );
75int mbedtls_x509_write_extensions( unsigned char **p, unsigned char *start,
76 mbedtls_asn1_named_data *first );
77int mbedtls_x509_write_names( unsigned char **p, unsigned char *start,
78 mbedtls_asn1_named_data *first );
79int mbedtls_x509_write_sig( unsigned char **p, unsigned char *start,
80 const char *oid, size_t oid_len,
81 unsigned char *sig, size_t size );
82
83#endif /* MBEDTLS_X509_INTERNAL_H */