PolarSSL v1.3.7
Macros | Typedefs | Functions
compat-1.2.h File Reference

Backwards compatibility header for PolarSSL-1.2 from PolarSSL-1.3. More...

#include "config.h"
#include "sha256.h"
#include "sha512.h"
#include "x509.h"
#include "x509_crt.h"
#include "x509_crl.h"
#include "x509_csr.h"
#include "ssl_ciphersuites.h"
#include "rsa.h"
#include "pk.h"
Include dependency graph for compat-1.2.h:

Go to the source code of this file.

Macros

#define SHOW_PROTOTYPE_CHANGE_WARNINGS
 
#define POLARSSL_SHA2_C
 
#define POLARSSL_SHA4_C
 
#define SIG_RSA_RAW   POLARSSL_MD_NONE
 
#define SIG_RSA_MD2   POLARSSL_MD_MD2
 
#define SIG_RSA_MD4   POLARSSL_MD_MD4
 
#define SIG_RSA_MD5   POLARSSL_MD_MD5
 
#define SIG_RSA_SHA1   POLARSSL_MD_SHA1
 
#define SIG_RSA_SHA224   POLARSSL_MD_SHA224
 
#define SIG_RSA_SHA256   POLARSSL_MD_SHA256
 
#define SIG_RSA_SHA384   POLARSSL_MD_SHA384
 
#define SIG_RSA_SHA512   POLARSSL_MD_SHA512
 
#define POLARSSL_ERR_X509_CERT_INVALID_FORMAT   POLARSSL_ERR_X509_INVALID_FORMAT
 
#define POLARSSL_ERR_X509_CERT_INVALID_VERSION   POLARSSL_ERR_X509_INVALID_VERSION
 
#define POLARSSL_ERR_X509_CERT_INVALID_ALG   POLARSSL_ERR_X509_INVALID_ALG
 
#define POLARSSL_ERR_X509_CERT_UNKNOWN_SIG_ALG   POLARSSL_ERR_X509_UNKNOWN_SIG_ALG
 
#define POLARSSL_ERR_X509_CERT_INVALID_NAME   POLARSSL_ERR_X509_INVALID_NAME
 
#define POLARSSL_ERR_X509_CERT_INVALID_DATE   POLARSSL_ERR_X509_INVALID_DATE
 
#define POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS   POLARSSL_ERR_X509_INVALID_EXTENSIONS
 
#define POLARSSL_ERR_X509_CERT_SIG_MISMATCH   POLARSSL_ERR_X509_SIG_MISMATCH
 
#define POLARSSL_ERR_X509_CERT_INVALID_SIGNATURE   POLARSSL_ERR_X509_INVALID_SIGNATURE
 
#define POLARSSL_ERR_X509_CERT_INVALID_SERIAL   POLARSSL_ERR_X509_INVALID_SERIAL
 
#define POLARSSL_ERR_X509_CERT_UNKNOWN_VERSION   POLARSSL_ERR_X509_UNKNOWN_VERSION
 
#define POLARSSL_X509_PARSE_C
 
#define POLARSSL_X509_PARSE_C
 
#define POLARSSL_X509_PARSE_C
 
#define ssl_default_ciphersuites   ssl_list_ciphersuites()
 
#define POLARSSL_ERR_X509_PASSWORD_MISMATCH   POLARSSL_ERR_PK_PASSWORD_MISMATCH
 
#define POLARSSL_ERR_X509_KEY_INVALID_FORMAT   POLARSSL_ERR_PK_KEY_INVALID_FORMAT
 
#define POLARSSL_ERR_X509_UNKNOWN_PK_ALG   POLARSSL_ERR_PK_UNKNOWN_PK_ALG
 
#define POLARSSL_ERR_X509_CERT_INVALID_PUBKEY   POLARSSL_ERR_PK_INVALID_PUBKEY
 

Typedefs

typedef sha256_context sha2_context
 
typedef sha512_context sha4_context
 
typedef x509_crt x509_cert
 

Functions

static void sha2_starts (sha256_context *ctx, int is224)
 
static void sha2_update (sha256_context *ctx, const unsigned char *input, size_t ilen)
 
static void sha2_finish (sha256_context *ctx, unsigned char output[32])
 
static int sha2_file (const char *path, unsigned char output[32], int is224)
 
static void sha2 (const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
 
static void sha2_hmac_starts (sha256_context *ctx, const unsigned char *key, size_t keylen, int is224)
 
static void sha2_hmac_update (sha256_context *ctx, const unsigned char *input, size_t ilen)
 
static void sha2_hmac_finish (sha256_context *ctx, unsigned char output[32])
 
static void sha2_hmac_reset (sha256_context *ctx)
 
static void sha2_hmac (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
 
static int sha2_self_test (int verbose)
 
static void sha4_starts (sha512_context *ctx, int is384)
 
static void sha4_update (sha512_context *ctx, const unsigned char *input, size_t ilen)
 
static void sha4_finish (sha512_context *ctx, unsigned char output[64])
 
static int sha4_file (const char *path, unsigned char output[64], int is384)
 
static void sha4 (const unsigned char *input, size_t ilen, unsigned char output[32], int is384)
 
static void sha4_hmac_starts (sha512_context *ctx, const unsigned char *key, size_t keylen, int is384)
 
static void sha4_hmac_update (sha512_context *ctx, const unsigned char *input, size_t ilen)
 
static void sha4_hmac_finish (sha512_context *ctx, unsigned char output[64])
 
static void sha4_hmac_reset (sha512_context *ctx)
 
static void sha4_hmac (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
 
static int sha4_self_test (int verbose)
 
static int x509parse_serial_gets (char *buf, size_t size, const x509_buf *serial)
 
static int x509parse_dn_gets (char *buf, size_t size, const x509_name *dn)
 
static int x509parse_time_expired (const x509_time *time)
 
static int x509parse_crt_der (x509_cert *chain, const unsigned char *buf, size_t buflen)
 
static int x509parse_crt (x509_cert *chain, const unsigned char *buf, size_t buflen)
 
static int x509parse_crtfile (x509_cert *chain, const char *path)
 
static int x509parse_crtpath (x509_cert *chain, const char *path)
 
static int x509parse_cert_info (char *buf, size_t size, const char *prefix, const x509_cert *crt)
 
static int x509parse_verify (x509_cert *crt, x509_cert *trust_ca, x509_crl *ca_crl, const char *cn, int *flags, int(*f_vrfy)(void *, x509_cert *, int, int *), void *p_vrfy)
 
static int x509parse_revoked (const x509_cert *crt, const x509_crl *crl)
 
static void x509_free (x509_cert *crt)
 
static int x509parse_crl (x509_crl *chain, const unsigned char *buf, size_t buflen)
 
static int x509parse_crlfile (x509_crl *chain, const char *path)
 
static int x509parse_crl_info (char *buf, size_t size, const char *prefix, const x509_crl *crl)
 
static int x509parse_csr (x509_csr *csr, const unsigned char *buf, size_t buflen)
 
static int x509parse_csrfile (x509_csr *csr, const char *path)
 
static int x509parse_csr_info (char *buf, size_t size, const char *prefix, const x509_csr *csr)
 
static int x509parse_keyfile (rsa_context *rsa, const char *path, const char *pwd)
 
static int x509parse_public_keyfile (rsa_context *rsa, const char *path)
 
static int x509parse_key (rsa_context *rsa, const unsigned char *key, size_t keylen, const unsigned char *pwd, size_t pwdlen)
 
static int x509parse_public_key (rsa_context *rsa, const unsigned char *key, size_t keylen)
 
static int x509_write_pubkey_der (unsigned char *buf, size_t len, rsa_context *rsa)
 
static int x509_write_key_der (unsigned char *buf, size_t len, rsa_context *rsa)
 

Detailed Description

Backwards compatibility header for PolarSSL-1.2 from PolarSSL-1.3.

Copyright (C) 2006-2013, Brainspark B.V.

This file is part of PolarSSL (http://www.polarssl.org) Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file compat-1.2.h.

Macro Definition Documentation

#define POLARSSL_ERR_X509_CERT_INVALID_ALG   POLARSSL_ERR_X509_INVALID_ALG

Definition at line 199 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_DATE   POLARSSL_ERR_X509_INVALID_DATE

Definition at line 202 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS   POLARSSL_ERR_X509_INVALID_EXTENSIONS

Definition at line 203 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_FORMAT   POLARSSL_ERR_X509_INVALID_FORMAT

Definition at line 197 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_NAME   POLARSSL_ERR_X509_INVALID_NAME

Definition at line 201 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_PUBKEY   POLARSSL_ERR_PK_INVALID_PUBKEY

Definition at line 299 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_SERIAL   POLARSSL_ERR_X509_INVALID_SERIAL

Definition at line 206 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_SIGNATURE   POLARSSL_ERR_X509_INVALID_SIGNATURE

Definition at line 205 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_VERSION   POLARSSL_ERR_X509_INVALID_VERSION

Definition at line 198 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_SIG_MISMATCH   POLARSSL_ERR_X509_SIG_MISMATCH

Definition at line 204 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_UNKNOWN_SIG_ALG   POLARSSL_ERR_X509_UNKNOWN_SIG_ALG

Definition at line 200 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_UNKNOWN_VERSION   POLARSSL_ERR_X509_UNKNOWN_VERSION

Definition at line 207 of file compat-1.2.h.

#define POLARSSL_ERR_X509_KEY_INVALID_FORMAT   POLARSSL_ERR_PK_KEY_INVALID_FORMAT

Definition at line 297 of file compat-1.2.h.

#define POLARSSL_ERR_X509_PASSWORD_MISMATCH   POLARSSL_ERR_PK_PASSWORD_MISMATCH

Definition at line 296 of file compat-1.2.h.

#define POLARSSL_ERR_X509_UNKNOWN_PK_ALG   POLARSSL_ERR_PK_UNKNOWN_PK_ALG

Definition at line 298 of file compat-1.2.h.

#define POLARSSL_SHA2_C

Definition at line 57 of file compat-1.2.h.

#define POLARSSL_SHA4_C

Definition at line 106 of file compat-1.2.h.

#define POLARSSL_X509_PARSE_C

Definition at line 272 of file compat-1.2.h.

#define POLARSSL_X509_PARSE_C

Definition at line 272 of file compat-1.2.h.

#define POLARSSL_X509_PARSE_C

Definition at line 272 of file compat-1.2.h.

#define SHOW_PROTOTYPE_CHANGE_WARNINGS

Definition at line 37 of file compat-1.2.h.

#define SIG_RSA_MD2   POLARSSL_MD_MD2

Definition at line 162 of file compat-1.2.h.

#define SIG_RSA_MD4   POLARSSL_MD_MD4

Definition at line 163 of file compat-1.2.h.

#define SIG_RSA_MD5   POLARSSL_MD_MD5

Definition at line 164 of file compat-1.2.h.

#define SIG_RSA_RAW   POLARSSL_MD_NONE

Definition at line 161 of file compat-1.2.h.

#define SIG_RSA_SHA1   POLARSSL_MD_SHA1

Definition at line 165 of file compat-1.2.h.

#define SIG_RSA_SHA224   POLARSSL_MD_SHA224

Definition at line 166 of file compat-1.2.h.

#define SIG_RSA_SHA256   POLARSSL_MD_SHA256

Definition at line 167 of file compat-1.2.h.

#define SIG_RSA_SHA384   POLARSSL_MD_SHA384

Definition at line 168 of file compat-1.2.h.

#define SIG_RSA_SHA512   POLARSSL_MD_SHA512

Definition at line 169 of file compat-1.2.h.

#define ssl_default_ciphersuites   ssl_list_ciphersuites()

Definition at line 289 of file compat-1.2.h.

Typedef Documentation

Definition at line 63 of file compat-1.2.h.

Definition at line 112 of file compat-1.2.h.

Definition at line 223 of file compat-1.2.h.

Function Documentation

static void sha2 ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[32],
int  is224 
)
inlinestatic

Definition at line 78 of file compat-1.2.h.

References sha256().

static int sha2_file ( const char *  path,
unsigned char  output[32],
int  is224 
)
inlinestatic

Definition at line 75 of file compat-1.2.h.

References sha256_file().

static void sha2_finish ( sha256_context ctx,
unsigned char  output[32] 
)
inlinestatic

Definition at line 72 of file compat-1.2.h.

References sha256_finish().

static void sha2_hmac ( const unsigned char *  key,
size_t  keylen,
const unsigned char *  input,
size_t  ilen,
unsigned char  output[32],
int  is224 
)
inlinestatic

Definition at line 95 of file compat-1.2.h.

References sha256_hmac().

static void sha2_hmac_finish ( sha256_context ctx,
unsigned char  output[32] 
)
inlinestatic

Definition at line 89 of file compat-1.2.h.

References sha256_hmac_finish().

static void sha2_hmac_reset ( sha256_context ctx)
inlinestatic

Definition at line 92 of file compat-1.2.h.

References sha256_hmac_reset().

static void sha2_hmac_starts ( sha256_context ctx,
const unsigned char *  key,
size_t  keylen,
int  is224 
)
inlinestatic

Definition at line 82 of file compat-1.2.h.

References sha256_hmac_starts().

static void sha2_hmac_update ( sha256_context ctx,
const unsigned char *  input,
size_t  ilen 
)
inlinestatic

Definition at line 86 of file compat-1.2.h.

References sha256_hmac_update().

static int sha2_self_test ( int  verbose)
inlinestatic

Definition at line 100 of file compat-1.2.h.

References sha256_self_test().

static void sha2_starts ( sha256_context ctx,
int  is224 
)
inlinestatic

Definition at line 65 of file compat-1.2.h.

References sha256_starts().

static void sha2_update ( sha256_context ctx,
const unsigned char *  input,
size_t  ilen 
)
inlinestatic

Definition at line 68 of file compat-1.2.h.

References sha256_update().

static void sha4 ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[32],
int  is384 
)
inlinestatic

Definition at line 127 of file compat-1.2.h.

References sha512().

static int sha4_file ( const char *  path,
unsigned char  output[64],
int  is384 
)
inlinestatic

Definition at line 124 of file compat-1.2.h.

References sha512_file().

static void sha4_finish ( sha512_context ctx,
unsigned char  output[64] 
)
inlinestatic

Definition at line 121 of file compat-1.2.h.

References sha512_finish().

static void sha4_hmac ( const unsigned char *  key,
size_t  keylen,
const unsigned char *  input,
size_t  ilen,
unsigned char  output[64],
int  is384 
)
inlinestatic

Definition at line 144 of file compat-1.2.h.

References sha512_hmac().

static void sha4_hmac_finish ( sha512_context ctx,
unsigned char  output[64] 
)
inlinestatic

Definition at line 138 of file compat-1.2.h.

References sha512_hmac_finish().

static void sha4_hmac_reset ( sha512_context ctx)
inlinestatic

Definition at line 141 of file compat-1.2.h.

References sha512_hmac_reset().

static void sha4_hmac_starts ( sha512_context ctx,
const unsigned char *  key,
size_t  keylen,
int  is384 
)
inlinestatic

Definition at line 131 of file compat-1.2.h.

References sha512_hmac_starts().

static void sha4_hmac_update ( sha512_context ctx,
const unsigned char *  input,
size_t  ilen 
)
inlinestatic

Definition at line 135 of file compat-1.2.h.

References sha512_hmac_update().

static int sha4_self_test ( int  verbose)
inlinestatic

Definition at line 149 of file compat-1.2.h.

References sha512_self_test().

static void sha4_starts ( sha512_context ctx,
int  is384 
)
inlinestatic

Definition at line 114 of file compat-1.2.h.

References sha512_starts().

static void sha4_update ( sha512_context ctx,
const unsigned char *  input,
size_t  ilen 
)
inlinestatic

Definition at line 117 of file compat-1.2.h.

References sha512_update().

static void x509_free ( x509_cert crt)
inlinestatic

Definition at line 251 of file compat-1.2.h.

References x509_crt_free().

static int x509_write_key_der ( unsigned char *  buf,
size_t  len,
rsa_context rsa 
)
inlinestatic
static int x509_write_pubkey_der ( unsigned char *  buf,
size_t  len,
rsa_context rsa 
)
inlinestatic
static int x509parse_cert_info ( char *  buf,
size_t  size,
const char *  prefix,
const x509_cert crt 
)
inlinestatic

Definition at line 238 of file compat-1.2.h.

References x509_crt_info().

static int x509parse_crl ( x509_crl chain,
const unsigned char *  buf,
size_t  buflen 
)
inlinestatic

Definition at line 259 of file compat-1.2.h.

References x509_crl_parse().

static int x509parse_crl_info ( char *  buf,
size_t  size,
const char *  prefix,
const x509_crl crl 
)
inlinestatic

Definition at line 265 of file compat-1.2.h.

References x509_crl_info().

static int x509parse_crlfile ( x509_crl chain,
const char *  path 
)
inlinestatic

Definition at line 262 of file compat-1.2.h.

References x509_crl_parse_file().

static int x509parse_crt ( x509_cert chain,
const unsigned char *  buf,
size_t  buflen 
)
inlinestatic

Definition at line 229 of file compat-1.2.h.

References x509_crt_parse().

static int x509parse_crt_der ( x509_cert chain,
const unsigned char *  buf,
size_t  buflen 
)
inlinestatic

Definition at line 225 of file compat-1.2.h.

References x509_crt_parse_der().

static int x509parse_crtfile ( x509_cert chain,
const char *  path 
)
inlinestatic

Definition at line 232 of file compat-1.2.h.

References x509_crt_parse_file().

static int x509parse_crtpath ( x509_cert chain,
const char *  path 
)
inlinestatic

Definition at line 235 of file compat-1.2.h.

References x509_crt_parse_path().

static int x509parse_csr ( x509_csr csr,
const unsigned char *  buf,
size_t  buflen 
)
inlinestatic

Definition at line 274 of file compat-1.2.h.

References x509_csr_parse().

static int x509parse_csr_info ( char *  buf,
size_t  size,
const char *  prefix,
const x509_csr csr 
)
inlinestatic

Definition at line 280 of file compat-1.2.h.

References x509_csr_info().

static int x509parse_csrfile ( x509_csr csr,
const char *  path 
)
inlinestatic

Definition at line 277 of file compat-1.2.h.

References x509_csr_parse_file().

static int x509parse_dn_gets ( char *  buf,
size_t  size,
const x509_name dn 
)
inlinestatic

Definition at line 212 of file compat-1.2.h.

References x509_dn_gets().

static int x509parse_key ( rsa_context rsa,
const unsigned char *  key,
size_t  keylen,
const unsigned char *  pwd,
size_t  pwdlen 
)
inlinestatic
static int x509parse_keyfile ( rsa_context rsa,
const char *  path,
const char *  pwd 
)
inlinestatic
static int x509parse_public_key ( rsa_context rsa,
const unsigned char *  key,
size_t  keylen 
)
inlinestatic
static int x509parse_public_keyfile ( rsa_context rsa,
const char *  path 
)
inlinestatic
static int x509parse_revoked ( const x509_cert crt,
const x509_crl crl 
)
inlinestatic

Definition at line 248 of file compat-1.2.h.

References x509_crt_revoked().

static int x509parse_serial_gets ( char *  buf,
size_t  size,
const x509_buf serial 
)
inlinestatic

Definition at line 209 of file compat-1.2.h.

References x509_serial_gets().

static int x509parse_time_expired ( const x509_time time)
inlinestatic

Definition at line 215 of file compat-1.2.h.

References x509_time_expired().

static int x509parse_verify ( x509_cert crt,
x509_cert trust_ca,
x509_crl ca_crl,
const char *  cn,
int *  flags,
int(*)(void *, x509_cert *, int, int *)  f_vrfy,
void *  p_vrfy 
)
inlinestatic

Definition at line 242 of file compat-1.2.h.

References x509_crt_verify().