godot/thirdparty/mbedtls/library/x509_csr.c

/*
 *  X.509 Certificate Signing Request (CSR) parsing
 *
 *  Copyright The Mbed TLS Contributors
 *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
 */
/*
 *  The ITU-T X.509 standard defines a certificate format for PKI.
 *
 *  http://www.ietf.org/rfc/rfc5280.txt (Certificates and CRLs)
 *  http://www.ietf.org/rfc/rfc3279.txt (Alg IDs for CRLs)
 *  http://www.ietf.org/rfc/rfc2986.txt (CSRs, aka PKCS#10)
 *
 *  http://www.itu.int/ITU-T/studygroups/com17/languages/X.680-0207.pdf
 *  http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf
 */

#include "common.h"

#if defined(MBEDTLS_X509_CSR_PARSE_C)

#include "mbedtls/x509_csr.h"
#include "x509_internal.h"
#include "mbedtls/error.h"
#include "mbedtls/oid.h"
#include "mbedtls/platform_util.h"

#include <string.h>

#if defined(MBEDTLS_PEM_PARSE_C)
#include "mbedtls/pem.h"
#endif

#include "mbedtls/platform.h"

#if defined(MBEDTLS_FS_IO) || defined(EFIX64) || defined(EFI32)
#include <stdio.h>
#endif

/*
 *  Version  ::=  INTEGER  {  v1(0)  }
 */
static int x509_csr_get_version(unsigned char **p,
                                const unsigned char *end,
                                int *ver)
{}

/*
 * Parse CSR extension requests in DER format
 */
static int x509_csr_parse_extensions(mbedtls_x509_csr *csr,
                                     unsigned char **p, const unsigned char *end,
                                     mbedtls_x509_csr_ext_cb_t cb,
                                     void *p_ctx)
{}

/*
 * Parse CSR attributes in DER format
 */
static int x509_csr_parse_attributes(mbedtls_x509_csr *csr,
                                     const unsigned char *start, const unsigned char *end,
                                     mbedtls_x509_csr_ext_cb_t cb,
                                     void *p_ctx)
{}

/*
 * Parse a CSR in DER format
 */
static int mbedtls_x509_csr_parse_der_internal(mbedtls_x509_csr *csr,
                                               const unsigned char *buf, size_t buflen,
                                               mbedtls_x509_csr_ext_cb_t cb,
                                               void *p_ctx)
{}

/*
 * Parse a CSR in DER format
 */
int mbedtls_x509_csr_parse_der(mbedtls_x509_csr *csr,
                               const unsigned char *buf, size_t buflen)
{}

/*
 * Parse a CSR in DER format with callback for unknown extensions
 */
int mbedtls_x509_csr_parse_der_with_ext_cb(mbedtls_x509_csr *csr,
                                           const unsigned char *buf, size_t buflen,
                                           mbedtls_x509_csr_ext_cb_t cb,
                                           void *p_ctx)
{}

/*
 * Parse a CSR, allowing for PEM or raw DER encoding
 */
int mbedtls_x509_csr_parse(mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen)
{}

#if defined(MBEDTLS_FS_IO)
/*
 * Load a CSR into the structure
 */
int mbedtls_x509_csr_parse_file(mbedtls_x509_csr *csr, const char *path)
{}
#endif /* MBEDTLS_FS_IO */

#if !defined(MBEDTLS_X509_REMOVE_INFO)
#define BEFORE_COLON
#define BC
/*
 * Return an informational string about the CSR.
 */
int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix,
                          const mbedtls_x509_csr *csr)
{}
#endif /* MBEDTLS_X509_REMOVE_INFO */

/*
 * Initialize a CSR
 */
void mbedtls_x509_csr_init(mbedtls_x509_csr *csr)
{}

/*
 * Unallocate all CSR data
 */
void mbedtls_x509_csr_free(mbedtls_x509_csr *csr)
{}

#endif /* MBEDTLS_X509_CSR_PARSE_C */