PolarSSL v1.3.2
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

void sha2_starts (sha256_context *ctx, int is224)
 
void sha2_update (sha256_context *ctx, const unsigned char *input, size_t ilen)
 
void sha2_finish (sha256_context *ctx, unsigned char output[32])
 
int sha2_file (const char *path, unsigned char output[32], int is224)
 
void sha2 (const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
 
void sha2_hmac_starts (sha256_context *ctx, const unsigned char *key, size_t keylen, int is224)
 
void sha2_hmac_update (sha256_context *ctx, const unsigned char *input, size_t ilen)
 
void sha2_hmac_finish (sha256_context *ctx, unsigned char output[32])
 
void sha2_hmac_reset (sha256_context *ctx)
 
void sha2_hmac (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
 
int sha2_self_test (int verbose)
 
void sha4_starts (sha512_context *ctx, int is384)
 
void sha4_update (sha512_context *ctx, const unsigned char *input, size_t ilen)
 
void sha4_finish (sha512_context *ctx, unsigned char output[64])
 
int sha4_file (const char *path, unsigned char output[64], int is384)
 
void sha4 (const unsigned char *input, size_t ilen, unsigned char output[32], int is384)
 
void sha4_hmac_starts (sha512_context *ctx, const unsigned char *key, size_t keylen, int is384)
 
void sha4_hmac_update (sha512_context *ctx, const unsigned char *input, size_t ilen)
 
void sha4_hmac_finish (sha512_context *ctx, unsigned char output[64])
 
void sha4_hmac_reset (sha512_context *ctx)
 
void sha4_hmac (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
 
int sha4_self_test (int verbose)
 
int x509parse_serial_gets (char *buf, size_t size, const x509_buf *serial)
 
int x509parse_dn_gets (char *buf, size_t size, const x509_name *dn)
 
int x509parse_time_expired (const x509_time *time)
 
int x509parse_crt_der (x509_cert *chain, const unsigned char *buf, size_t buflen)
 
int x509parse_crt (x509_cert *chain, const unsigned char *buf, size_t buflen)
 
int x509parse_crtfile (x509_cert *chain, const char *path)
 
int x509parse_crtpath (x509_cert *chain, const char *path)
 
int x509parse_cert_info (char *buf, size_t size, const char *prefix, const x509_cert *crt)
 
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)
 
int x509parse_revoked (const x509_cert *crt, const x509_crl *crl)
 
void x509_free (x509_cert *crt)
 
int x509parse_crl (x509_crl *chain, const unsigned char *buf, size_t buflen)
 
int x509parse_crlfile (x509_crl *chain, const char *path)
 
int x509parse_crl_info (char *buf, size_t size, const char *prefix, const x509_crl *crl)
 
int x509parse_csr (x509_csr *csr, const unsigned char *buf, size_t buflen)
 
int x509parse_csrfile (x509_csr *csr, const char *path)
 
int x509parse_csr_info (char *buf, size_t size, const char *prefix, const x509_csr *csr)
 
int x509parse_keyfile (rsa_context *rsa, const char *path, const char *pwd)
 
int x509parse_public_keyfile (rsa_context *rsa, const char *path)
 
int x509parse_key (rsa_context *rsa, const unsigned char *key, size_t keylen, const unsigned char *pwd, size_t pwdlen)
 
int x509parse_public_key (rsa_context *rsa, const unsigned char *key, size_t keylen)
 
int x509_write_pubkey_der (unsigned char *buf, size_t len, rsa_context *rsa)
 
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 195 of file compat-1.2.h.

#define POLARSSL_ERR_X509_CERT_INVALID_DATE   POLARSSL_ERR_X509_INVALID_DATE

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

#define POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS   POLARSSL_ERR_X509_INVALID_EXTENSIONS

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

#define POLARSSL_ERR_X509_CERT_INVALID_FORMAT   POLARSSL_ERR_X509_INVALID_FORMAT

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

#define POLARSSL_ERR_X509_CERT_INVALID_NAME   POLARSSL_ERR_X509_INVALID_NAME

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

#define POLARSSL_ERR_X509_CERT_INVALID_PUBKEY   POLARSSL_ERR_PK_INVALID_PUBKEY

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

#define POLARSSL_ERR_X509_CERT_INVALID_SERIAL   POLARSSL_ERR_X509_INVALID_SERIAL

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

#define POLARSSL_ERR_X509_CERT_INVALID_SIGNATURE   POLARSSL_ERR_X509_INVALID_SIGNATURE

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

#define POLARSSL_ERR_X509_CERT_INVALID_VERSION   POLARSSL_ERR_X509_INVALID_VERSION

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

#define POLARSSL_ERR_X509_CERT_SIG_MISMATCH   POLARSSL_ERR_X509_SIG_MISMATCH

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

#define POLARSSL_ERR_X509_CERT_UNKNOWN_SIG_ALG   POLARSSL_ERR_X509_UNKNOWN_SIG_ALG

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

#define POLARSSL_ERR_X509_CERT_UNKNOWN_VERSION   POLARSSL_ERR_X509_UNKNOWN_VERSION

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

#define POLARSSL_ERR_X509_KEY_INVALID_FORMAT   POLARSSL_ERR_PK_KEY_INVALID_FORMAT

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

#define POLARSSL_ERR_X509_PASSWORD_MISMATCH   POLARSSL_ERR_PK_PASSWORD_MISMATCH

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

#define POLARSSL_ERR_X509_UNKNOWN_PK_ALG   POLARSSL_ERR_PK_UNKNOWN_PK_ALG

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

#define POLARSSL_SHA2_C

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

#define POLARSSL_SHA4_C

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

#define POLARSSL_X509_PARSE_C

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

#define POLARSSL_X509_PARSE_C

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

#define POLARSSL_X509_PARSE_C

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

#define SHOW_PROTOTYPE_CHANGE_WARNINGS

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

#define SIG_RSA_MD2   POLARSSL_MD_MD2

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

#define SIG_RSA_MD4   POLARSSL_MD_MD4

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

#define SIG_RSA_MD5   POLARSSL_MD_MD5

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

#define SIG_RSA_RAW   POLARSSL_MD_NONE

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

#define SIG_RSA_SHA1   POLARSSL_MD_SHA1

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

#define SIG_RSA_SHA224   POLARSSL_MD_SHA224

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

#define SIG_RSA_SHA256   POLARSSL_MD_SHA256

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

#define SIG_RSA_SHA384   POLARSSL_MD_SHA384

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

#define SIG_RSA_SHA512   POLARSSL_MD_SHA512

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

#define ssl_default_ciphersuites   ssl_list_ciphersuites()

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

Typedef Documentation

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

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

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

Function Documentation

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

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

References sha256().

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

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

References sha256_file().

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

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

References sha256_finish().

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

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

References sha256_hmac().

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

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

References sha256_hmac_finish().

void sha2_hmac_reset ( sha256_context ctx)
inline

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

References sha256_hmac_reset().

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

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

References sha256_hmac_starts().

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

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

References sha256_hmac_update().

int sha2_self_test ( int  verbose)
inline

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

References sha256_self_test().

void sha2_starts ( sha256_context ctx,
int  is224 
)
inline

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

References sha256_starts().

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

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

References sha256_update().

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

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

References sha512().

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

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

References sha512_file().

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

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

References sha512_finish().

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

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

References sha512_hmac().

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

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

References sha512_hmac_finish().

void sha4_hmac_reset ( sha512_context ctx)
inline

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

References sha512_hmac_reset().

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

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

References sha512_hmac_starts().

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

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

References sha512_hmac_update().

int sha4_self_test ( int  verbose)
inline

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

References sha512_self_test().

void sha4_starts ( sha512_context ctx,
int  is384 
)
inline

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

References sha512_starts().

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

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

References sha512_update().

void x509_free ( x509_cert crt)
inline

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

References x509_crt_free().

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

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

References x509_crt_info().

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

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

References x509_crl_parse().

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

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

References x509_crl_info().

int x509parse_crlfile ( x509_crl chain,
const char *  path 
)
inline

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

References x509_crl_parse_file().

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

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

References x509_crt_parse().

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

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

References x509_crt_parse_der().

int x509parse_crtfile ( x509_cert chain,
const char *  path 
)
inline

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

References x509_crt_parse_file().

int x509parse_crtpath ( x509_cert chain,
const char *  path 
)
inline

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

References x509_crt_parse_path().

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

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

References x509_csr_parse().

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

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

References x509_csr_info().

int x509parse_csrfile ( x509_csr csr,
const char *  path 
)
inline

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

References x509_csr_parse_file().

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

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

References x509_dn_gets().

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

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

References x509_crt_revoked().

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

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

References x509_serial_gets().

int x509parse_time_expired ( const x509_time time)
inline

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

References x509_time_expired().

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 
)
inline

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

References x509_crt_verify().