Main Page | Class List | Directories | File List | Class Members | File Members

sess_id.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>

Go to the source code of this file.

Defines

#define PROG   sess_id_main

Functions

static SSL_SESSIONload_sess_id (char *file, int format)
int MAIN (int, char **)

Variables

static const char * sess_id_usage []


Define Documentation

#define PROG   sess_id_main
 

Definition at line 70 of file sess_id.c.


Function Documentation

static SSL_SESSION * load_sess_id char *  file,
int  format
[static]
 

Definition at line 279 of file sess_id.c.

References bio_err, BIO_free(), BIO_new(), BIO_NOCLOSE, BIO_printf(), BIO_read_filename, BIO_s_file(), BIO_set_fp, d2i_SSL_SESSION_bio, ERR_print_errors(), FORMAT_ASN1, FORMAT_PEM, in, and PEM_read_bio_SSL_SESSION.

00280         {
00281         SSL_SESSION *x=NULL;
00282         BIO *in=NULL;
00283 
00284         in=BIO_new(BIO_s_file());
00285         if (in == NULL)
00286                 {
00287                 ERR_print_errors(bio_err);
00288                 goto end;
00289                 }
00290 
00291         if (infile == NULL)
00292                 BIO_set_fp(in,stdin,BIO_NOCLOSE);
00293         else
00294                 {
00295                 if (BIO_read_filename(in,infile) <= 0)
00296                         {
00297                         perror(infile);
00298                         goto end;
00299                         }
00300                 }
00301         if      (format == FORMAT_ASN1)
00302                 x=d2i_SSL_SESSION_bio(in,NULL);
00303         else if (format == FORMAT_PEM)
00304                 x=PEM_read_bio_SSL_SESSION(in,NULL,NULL,NULL);
00305         else    {
00306                 BIO_printf(bio_err,"bad input format specified for input crl\n");
00307                 goto end;
00308                 }
00309         if (x == NULL)
00310                 {
00311                 BIO_printf(bio_err,"unable to load SSL_SESSION\n");
00312                 ERR_print_errors(bio_err);
00313                 goto end;
00314                 }
00315         
00316 end:
00317         if (in != NULL) BIO_free(in);
00318         return(x);
00319         }

int MAIN int  ,
char ** 
 


Variable Documentation

const char* sess_id_usage[] [static]
 

Initial value:

{
"usage: sess_id args\n",
"\n",
" -inform arg     - input format - default PEM (DER or PEM)\n",
" -outform arg    - output format - default PEM\n",
" -in arg         - input file - default stdin\n",
" -out arg        - output file - default stdout\n",
" -text           - print ssl session id details\n",
" -cert           - output certificate \n",
" -noout          - no CRL output\n",
" -context arg    - set the session ID context\n",
NULL
}

Definition at line 72 of file sess_id.c.


© sourcejam.com 2005-2008