OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Macros | Typedefs | Functions | Variables
apps.h File Reference
#include "e_os.h"
#include <openssl/bio.h>
#include <openssl/x509.h>
#include <openssl/lhash.h>
#include <openssl/conf.h>
#include <openssl/txt_db.h>
#include <openssl/engine.h>
#include <openssl/ocsp.h>
#include <openssl/ossl_typ.h>
#include <signal.h>

Go to the source code of this file.

Classes

struct  args_st
 
struct  pw_cb_data
 
struct  db_attr_st
 
struct  ca_db_st
 

Macros

#define MAIN(a, v)   main(a,v)
 
#define do_pipe_sig()
 
#define zlib_cleanup()   COMP_zlib_cleanup()
 
#define apps_startup()
 
#define apps_shutdown()
 
#define openssl_fdset(a, b)   FD_SET(a, b)
 
#define PW_MIN_LENGTH   4
 
#define DB_type   0
 
#define DB_exp_date   1
 
#define DB_rev_date   2
 
#define DB_serial   3 /* index - unique */
 
#define DB_file   4
 
#define DB_name   5 /* index - unique when active and not disabled */
 
#define DB_NUMBER   6
 
#define DB_TYPE_REV   'R'
 
#define DB_TYPE_EXP   'E'
 
#define DB_TYPE_VAL   'V'
 
#define index_name_cmp_noconst(a, b)
 
#define FORMAT_UNDEF   0
 
#define FORMAT_ASN1   1
 
#define FORMAT_TEXT   2
 
#define FORMAT_PEM   3
 
#define FORMAT_NETSCAPE   4
 
#define FORMAT_PKCS12   5
 
#define FORMAT_SMIME   6
 
#define FORMAT_ENGINE   7
 
#define FORMAT_IISSGC
 
#define FORMAT_PEMRSA   9 /* PEM RSAPubicKey format */
 
#define FORMAT_ASN1RSA   10 /* DER RSAPubicKey format */
 
#define FORMAT_MSBLOB   11 /* MS Key blob format */
 
#define FORMAT_PVK   12 /* MS PVK file format */
 
#define EXT_COPY_NONE   0
 
#define EXT_COPY_ADD   1
 
#define EXT_COPY_ALL   2
 
#define NETSCAPE_CERT_HDR   "certificate"
 
#define APP_PASS_LEN   1024
 
#define SERIAL_RAND_BITS   64
 
#define TM_START   0
 
#define TM_STOP   1
 
#define OPENSSL_NO_SSL_INTERN
 

Typedefs

typedef struct args_st ARGS
 
typedef struct pw_cb_data PW_CB_DATA
 
typedef struct db_attr_st DB_ATTR
 
typedef struct ca_db_st CA_DB
 

Functions

int app_RAND_load_file (const char *file, BIO *bio_e, int dont_warn)
 
int app_RAND_write_file (const char *file, BIO *bio_e)
 
void app_RAND_allow_write_file (void)
 
long app_RAND_load_files (char *file)
 
int password_callback (char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data)
 
int setup_ui_method (void)
 
void destroy_ui_method (void)
 
int should_retry (int i)
 
int args_from_file (char *file, int *argc, char **argv[])
 
int str2fmt (char *s)
 
void program_name (char *in, char *out, int size)
 
int chopup_args (ARGS *arg, char *buf, int *argc, char **argv[])
 
int set_cert_ex (unsigned long *flags, const char *arg)
 
int set_name_ex (unsigned long *flags, const char *arg)
 
int set_ext_copy (int *copy_type, const char *arg)
 
int copy_extensions (X509 *x, X509_REQ *req, int copy_type)
 
int app_passwd (BIO *err, char *arg1, char *arg2, char **pass1, char **pass2)
 
int add_oid_section (BIO *err, CONF *conf)
 
X509load_cert (BIO *err, const char *file, int format, const char *pass, ENGINE *e, const char *cert_descrip)
 
EVP_PKEYload_key (BIO *err, const char *file, int format, int maybe_stdin, const char *pass, ENGINE *e, const char *key_descrip)
 
EVP_PKEYload_pubkey (BIO *err, const char *file, int format, int maybe_stdin, const char *pass, ENGINE *e, const char *key_descrip)
 
 STACK_OF (X509)*load_certs(BIO *err
 
 STACK_OF (X509_CRL)*load_crls(BIO *err
 
X509_STOREsetup_verify (BIO *bp, char *CAfile, char *CApath)
 
ENGINEsetup_engine (BIO *err, const char *engine, int debug)
 
OCSP_RESPONSEprocess_responder (BIO *err, OCSP_REQUEST *req, char *host, char *path, char *port, int use_ssl, STACK_OF(CONF_VALUE)*headers, int req_timeout)
 
int load_config (BIO *err, CONF *cnf)
 
char * make_config_name (void)
 
int unpack_revinfo (ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, const char *str)
 
BIGNUMload_serial (char *serialfile, int create, ASN1_INTEGER **retai)
 
int save_serial (char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai)
 
int rotate_serial (char *serialfile, char *new_suffix, char *old_suffix)
 
int rand_serial (BIGNUM *b, ASN1_INTEGER *ai)
 
CA_DBload_index (char *dbfile, DB_ATTR *dbattr)
 
int index_index (CA_DB *db)
 
int save_index (const char *dbfile, const char *suffix, CA_DB *db)
 
int rotate_index (const char *dbfile, const char *new_suffix, const char *old_suffix)
 
void free_index (CA_DB *db)
 
int index_name_cmp (const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
 
int parse_yesno (const char *str, int def)
 
X509_NAMEparse_name (char *str, long chtype, int multirdn)
 
int args_verify (char ***pargs, int *pargc, int *badarg, BIO *err, X509_VERIFY_PARAM **pm)
 
void policies_print (BIO *out, X509_STORE_CTX *ctx)
 
int bio_to_mem (unsigned char **out, int maxlen, BIO *in)
 
int pkey_ctrl_string (EVP_PKEY_CTX *ctx, char *value)
 
int init_gen_str (BIO *err, EVP_PKEY_CTX **pctx, const char *algname, ENGINE *e, int do_param)
 
int do_X509_sign (BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md, STACK_OF(OPENSSL_STRING)*sigopts)
 
int do_X509_REQ_sign (BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md, STACK_OF(OPENSSL_STRING)*sigopts)
 
int do_X509_CRL_sign (BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md, STACK_OF(OPENSSL_STRING)*sigopts)
 
void jpake_client_auth (BIO *out, BIO *conn, const char *secret)
 
void jpake_server_auth (BIO *out, BIO *conn, const char *secret)
 
unsigned char * next_protos_parse (unsigned short *outlen, const char *in)
 
int app_isdir (const char *)
 
int raw_read_stdin (void *, int)
 
int raw_write_stdout (const void *, int)
 
double app_tminterval (int stop, int usertime)
 

Variables

CONFconfig =NULL
 
BIObio_err =NULL
 
const char * file
 
const char int format
 
const char int const char * pass
 
const char int const char ENGINEe
 
const char int const char
ENGINE const char * 
cert_descrip
 
char * psk_key
 

Macro Definition Documentation

#define APP_PASS_LEN   1024

Definition at line 358 of file apps.h.

#define apps_shutdown ( )
Value:
OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
ERR_free_strings(); zlib_cleanup();} while(0)

Definition at line 187 of file apps.h.

#define apps_startup ( )
Value:
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)

Definition at line 183 of file apps.h.

#define DB_exp_date   1

Definition at line 276 of file apps.h.

#define DB_file   4

Definition at line 279 of file apps.h.

#define DB_name   5 /* index - unique when active and not disabled */

Definition at line 280 of file apps.h.

#define DB_NUMBER   6

Definition at line 281 of file apps.h.

#define DB_rev_date   2

Definition at line 277 of file apps.h.

#define DB_serial   3 /* index - unique */

Definition at line 278 of file apps.h.

#define DB_type   0

Definition at line 275 of file apps.h.

#define DB_TYPE_EXP   'E'

Definition at line 284 of file apps.h.

#define DB_TYPE_REV   'R'

Definition at line 283 of file apps.h.

#define DB_TYPE_VAL   'V'

Definition at line 285 of file apps.h.

#define do_pipe_sig ( )

Definition at line 168 of file apps.h.

#define EXT_COPY_ADD   1

Definition at line 353 of file apps.h.

#define EXT_COPY_ALL   2

Definition at line 354 of file apps.h.

#define EXT_COPY_NONE   0

Definition at line 352 of file apps.h.

#define FORMAT_ASN1   1

Definition at line 339 of file apps.h.

#define FORMAT_ASN1RSA   10 /* DER RSAPubicKey format */

Definition at line 348 of file apps.h.

#define FORMAT_ENGINE   7

Definition at line 345 of file apps.h.

#define FORMAT_IISSGC
Value:
8 /* XXX this stupid macro helps us to avoid
* adding yet another param to load_*key() */

Definition at line 346 of file apps.h.

#define FORMAT_MSBLOB   11 /* MS Key blob format */

Definition at line 349 of file apps.h.

#define FORMAT_NETSCAPE   4

Definition at line 342 of file apps.h.

#define FORMAT_PEM   3

Definition at line 341 of file apps.h.

#define FORMAT_PEMRSA   9 /* PEM RSAPubicKey format */

Definition at line 347 of file apps.h.

#define FORMAT_PKCS12   5

Definition at line 343 of file apps.h.

#define FORMAT_PVK   12 /* MS PVK file format */

Definition at line 350 of file apps.h.

#define FORMAT_SMIME   6

Definition at line 344 of file apps.h.

#define FORMAT_TEXT   2

Definition at line 340 of file apps.h.

#define FORMAT_UNDEF   0

Definition at line 338 of file apps.h.

#define index_name_cmp_noconst (   a,
  b 
)
#define MAIN (   a,
 
)    main(a,v)

Definition at line 142 of file apps.h.

#define NETSCAPE_CERT_HDR   "certificate"

Definition at line 356 of file apps.h.

#define openssl_fdset (   a,
  b 
)    FD_SET(a, b)

Definition at line 208 of file apps.h.

#define OPENSSL_NO_SSL_INTERN

Definition at line 370 of file apps.h.

#define PW_MIN_LENGTH   4

Definition at line 218 of file apps.h.

#define SERIAL_RAND_BITS   64

Definition at line 360 of file apps.h.

#define TM_START   0

Definition at line 366 of file apps.h.

#define TM_STOP   1

Definition at line 367 of file apps.h.

#define zlib_cleanup ( )    COMP_zlib_cleanup()

Definition at line 174 of file apps.h.

Typedef Documentation

typedef struct args_st ARGS
typedef struct ca_db_st CA_DB
typedef struct db_attr_st DB_ATTR
typedef struct pw_cb_data PW_CB_DATA

Function Documentation

int add_oid_section ( BIO err,
CONF conf 
)

Definition at line 715 of file apps.c.

int app_isdir ( const char *  )

Definition at line 3053 of file apps.c.

int app_passwd ( BIO err,
char *  arg1,
char *  arg2,
char **  pass1,
char **  pass2 
)

Definition at line 632 of file apps.c.

void app_RAND_allow_write_file ( void  )

Definition at line 215 of file app_rand.c.

int app_RAND_load_file ( const char *  file,
BIO bio_e,
int  dont_warn 
)

Definition at line 122 of file app_rand.c.

long app_RAND_load_files ( char *  file)

Definition at line 165 of file app_rand.c.

int app_RAND_write_file ( const char *  file,
BIO bio_e 
)

Definition at line 194 of file app_rand.c.

double app_tminterval ( int  stop,
int  usertime 
)

Definition at line 2999 of file apps.c.

int args_from_file ( char *  file,
int *  argc,
char **  argv[] 
)
int args_verify ( char ***  pargs,
int *  pargc,
int *  badarg,
BIO err,
X509_VERIFY_PARAM **  pm 
)

Definition at line 2252 of file apps.c.

int bio_to_mem ( unsigned char **  out,
int  maxlen,
BIO in 
)

Definition at line 2407 of file apps.c.

int chopup_args ( ARGS arg,
char *  buf,
int *  argc,
char **  argv[] 
)

Definition at line 380 of file apps.c.

int copy_extensions ( X509 x,
X509_REQ req,
int  copy_type 
)

Definition at line 1319 of file apps.c.

void destroy_ui_method ( void  )

Definition at line 539 of file apps.c.

int do_X509_CRL_sign ( BIO err,
X509_CRL x,
EVP_PKEY pkey,
const EVP_MD md,
STACK_OF(OPENSSL_STRING)*  sigopts 
)

Definition at line 1823 of file req.c.

int do_X509_REQ_sign ( BIO err,
X509_REQ x,
EVP_PKEY pkey,
const EVP_MD md,
STACK_OF(OPENSSL_STRING)*  sigopts 
)

Definition at line 1808 of file req.c.

int do_X509_sign ( BIO err,
X509 x,
EVP_PKEY pkey,
const EVP_MD md,
STACK_OF(OPENSSL_STRING)*  sigopts 
)

Definition at line 1794 of file req.c.

void free_index ( CA_DB db)

Definition at line 2078 of file apps.c.

int index_index ( CA_DB db)

Definition at line 1875 of file apps.c.

int index_name_cmp ( const OPENSSL_CSTRING a,
const OPENSSL_CSTRING b 
)

Definition at line 1578 of file apps.c.

int init_gen_str ( BIO err,
EVP_PKEY_CTX **  pctx,
const char *  algname,
ENGINE e,
int  do_param 
)

Definition at line 363 of file genpkey.c.

void jpake_client_auth ( BIO out,
BIO conn,
const char *  secret 
)

Definition at line 2663 of file apps.c.

void jpake_server_auth ( BIO out,
BIO conn,
const char *  secret 
)

Definition at line 2692 of file apps.c.

X509* load_cert ( BIO err,
const char *  file,
int  format,
const char *  pass,
ENGINE e,
const char *  cert_descrip 
)

Definition at line 786 of file apps.c.

int load_config ( BIO err,
CONF cnf 
)

Definition at line 1515 of file apps.c.

CA_DB* load_index ( char *  dbfile,
DB_ATTR dbattr 
)

Definition at line 1796 of file apps.c.

EVP_PKEY* load_key ( BIO err,
const char *  file,
int  format,
int  maybe_stdin,
const char *  pass,
ENGINE e,
const char *  key_descrip 
)

Definition at line 862 of file apps.c.

EVP_PKEY* load_pubkey ( BIO err,
const char *  file,
int  format,
int  maybe_stdin,
const char *  pass,
ENGINE e,
const char *  key_descrip 
)

Definition at line 960 of file apps.c.

BIGNUM* load_serial ( char *  serialfile,
int  create,
ASN1_INTEGER **  retai 
)
char* make_config_name ( void  )

Definition at line 1537 of file apps.c.

unsigned char* next_protos_parse ( unsigned short *  outlen,
const char *  in 
)

Definition at line 2732 of file apps.c.

X509_NAME* parse_name ( char *  str,
long  chtype,
int  multirdn 
)

Definition at line 2120 of file apps.c.

int parse_yesno ( const char *  str,
int  def 
)

Definition at line 2087 of file apps.c.

int password_callback ( char *  buf,
int  bufsiz,
int  verify,
PW_CB_DATA cb_data 
)

Definition at line 547 of file apps.c.

int pkey_ctrl_string ( EVP_PKEY_CTX ctx,
char *  value 
)

Definition at line 2440 of file apps.c.

void policies_print ( BIO out,
X509_STORE_CTX ctx 
)

Definition at line 2477 of file apps.c.

OCSP_RESPONSE* process_responder ( BIO err,
OCSP_REQUEST req,
char *  host,
char *  path,
char *  port,
int  use_ssl,
STACK_OF(CONF_VALUE)*  headers,
int  req_timeout 
)

Definition at line 1373 of file ocsp.c.

void program_name ( char *  in,
char *  out,
int  size 
)

Definition at line 366 of file apps.c.

int rand_serial ( BIGNUM b,
ASN1_INTEGER ai 
)

Definition at line 1769 of file apps.c.

int raw_read_stdin ( void ,
int   
)

Definition at line 3076 of file apps.c.

int raw_write_stdout ( const void ,
int   
)

Definition at line 3089 of file apps.c.

int rotate_index ( const char *  dbfile,
const char *  new_suffix,
const char *  old_suffix 
)

Definition at line 1966 of file apps.c.

int rotate_serial ( char *  serialfile,
char *  new_suffix,
char *  old_suffix 
)

Definition at line 1708 of file apps.c.

int save_index ( const char *  dbfile,
const char *  suffix,
CA_DB db 
)

Definition at line 1899 of file apps.c.

int save_serial ( char *  serialfile,
char *  suffix,
BIGNUM serial,
ASN1_INTEGER **  retai 
)

Definition at line 1646 of file apps.c.

int set_cert_ex ( unsigned long *  flags,
const char *  arg 
)

Definition at line 1245 of file apps.c.

int set_ext_copy ( int *  copy_type,
const char *  arg 
)

Definition at line 1306 of file apps.c.

int set_name_ex ( unsigned long *  flags,
const char *  arg 
)

Definition at line 1271 of file apps.c.

ENGINE* setup_engine ( BIO err,
const char *  engine,
int  debug 
)

Definition at line 1473 of file apps.c.

int setup_ui_method ( void  )

Definition at line 530 of file apps.c.

X509_STORE* setup_verify ( BIO bp,
char *  CAfile,
char *  CApath 
)

Definition at line 1426 of file apps.c.

int should_retry ( int  i)
STACK_OF ( X509  )

Definition at line 1214 of file apps.c.

STACK_OF ( X509_CRL  )

Definition at line 1223 of file apps.c.

int str2fmt ( char *  s)

Definition at line 258 of file apps.c.

int unpack_revinfo ( ASN1_TIME **  prevtm,
int *  preason,
ASN1_OBJECT **  phold,
ASN1_GENERALIZEDTIME **  pinvtm,
const char *  str 
)

Definition at line 2904 of file ca.c.

Variable Documentation

BIO* bio_err =NULL

Definition at line 146 of file apps.h.

const char int const char ENGINE const char * cert_descrip

Definition at line 252 of file apps.h.

CONF* config =NULL

Definition at line 145 of file apps.h.

const char int const char ENGINE * e

Definition at line 252 of file apps.h.

const char * file

Definition at line 252 of file apps.h.

const char int format

Definition at line 252 of file apps.h.

const char int const char * pass

Definition at line 252 of file apps.h.

char* psk_key

Definition at line 314 of file s_server.c.