Don't mix real tabs with tabs expanded as 8 spaces -- that's

a pain to read when using 4-space tabs.
This commit is contained in:
Bodo Möller 1999-06-07 20:26:51 +00:00
parent 9e06f6f601
commit b1c4fe3625
21 changed files with 224 additions and 224 deletions

View file

@ -247,8 +247,8 @@ int WIN32_rename(char *from, char *to)
ret=MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED); ret=MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED);
return(ret?0:-1); return(ret?0:-1);
#else #else
unlink(to); unlink(to);
return MoveFile(from, to); return MoveFile(from, to);
#endif #endif
} }
#endif #endif

View file

@ -122,10 +122,10 @@ extern BIO *bio_err;
#endif #endif
typedef struct args_st typedef struct args_st
{ {
char **data; char **data;
int count; int count;
} ARGS; } ARGS;
int should_retry(int i); int should_retry(int i);
int args_from_file(char *file, int *argc, char **argv[]); int args_from_file(char *file, int *argc, char **argv[]);

290
apps/ca.c
View file

@ -590,7 +590,7 @@ bad:
lookup_fail(section,ENV_DATABASE); lookup_fail(section,ENV_DATABASE);
goto err; goto err;
} }
if (BIO_read_filename(in,dbfile) <= 0) if (BIO_read_filename(in,dbfile) <= 0)
{ {
perror(dbfile); perror(dbfile);
BIO_printf(bio_err,"unable to open '%s'\n",dbfile); BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
@ -1126,65 +1126,65 @@ bad:
/*****************************************************************/ /*****************************************************************/
if (dorevoke) if (dorevoke)
{ {
in=BIO_new(BIO_s_file()); in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL)) if ((in == NULL) || (out == NULL))
{ {
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto err; goto err;
} }
if (infile == NULL) if (infile == NULL)
{ {
BIO_printf(bio_err,"no input files\n"); BIO_printf(bio_err,"no input files\n");
goto err; goto err;
} }
else else
{ {
if (BIO_read_filename(in,infile) <= 0) if (BIO_read_filename(in,infile) <= 0)
{ {
perror(infile); perror(infile);
BIO_printf(bio_err,"error trying to load '%s' certificate\n",infile); BIO_printf(bio_err,"error trying to load '%s' certificate\n",infile);
goto err;
}
x509=PEM_read_bio_X509(in,NULL,NULL);
if (x509 == NULL)
{
BIO_printf(bio_err,"unable to load '%s' certificate\n",infile);
goto err; goto err;
} }
j=do_revoke(x509,db); x509=PEM_read_bio_X509(in,NULL,NULL);
if (x509 == NULL)
{
BIO_printf(bio_err,"unable to load '%s' certificate\n",infile);
goto err;
}
j=do_revoke(x509,db);
strncpy(buf[0],dbfile,BSIZE-4); strncpy(buf[0],dbfile,BSIZE-4);
strcat(buf[0],".new"); strcat(buf[0],".new");
if (BIO_write_filename(out,buf[0]) <= 0) if (BIO_write_filename(out,buf[0]) <= 0)
{ {
perror(dbfile); perror(dbfile);
BIO_printf(bio_err,"unable to open '%s'\n",dbfile); BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
goto err; goto err;
} }
j=TXT_DB_write(out,db); j=TXT_DB_write(out,db);
if (j <= 0) goto err; if (j <= 0) goto err;
BIO_free(in); BIO_free(in);
BIO_free(out); BIO_free(out);
in=NULL; in=NULL;
out=NULL; out=NULL;
strncpy(buf[1],dbfile,BSIZE-4); strncpy(buf[1],dbfile,BSIZE-4);
strcat(buf[1],".old"); strcat(buf[1],".old");
if (rename(dbfile,buf[1]) < 0) if (rename(dbfile,buf[1]) < 0)
{ {
BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]); BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]);
perror("reason"); perror("reason");
goto err; goto err;
} }
if (rename(buf[0],dbfile) < 0) if (rename(buf[0],dbfile) < 0)
{ {
BIO_printf(bio_err,"unable to rename %s to %s\n", buf[0],dbfile); BIO_printf(bio_err,"unable to rename %s to %s\n", buf[0],dbfile);
perror("reason"); perror("reason");
rename(buf[1],dbfile); rename(buf[1],dbfile);
goto err; goto err;
} }
BIO_printf(bio_err,"Data Base Updated\n"); BIO_printf(bio_err,"Data Base Updated\n");
} }
} }
/*****************************************************************/ /*****************************************************************/
ret=0; ret=0;
@ -1707,7 +1707,7 @@ again2:
p="Valid"; p="Valid";
else else
p="\ninvalid type, Data base error\n"; p="\ninvalid type, Data base error\n";
BIO_printf(bio_err,"Type :%s\n",p);; BIO_printf(bio_err,"Type :%s\n",p);;
if (rrow[DB_type][0] == 'R') if (rrow[DB_type][0] == 'R')
{ {
p=rrow[DB_exp_date]; if (p == NULL) p="undef"; p=rrow[DB_exp_date]; if (p == NULL) p="undef";
@ -1805,8 +1805,8 @@ again2:
#ifndef NO_DSA #ifndef NO_DSA
if (pkey->type == EVP_PKEY_DSA) dgst=EVP_dss1(); if (pkey->type == EVP_PKEY_DSA) dgst=EVP_dss1();
pktmp=X509_get_pubkey(ret); pktmp=X509_get_pubkey(ret);
if (EVP_PKEY_missing_parameters(pktmp) && if (EVP_PKEY_missing_parameters(pktmp) &&
!EVP_PKEY_missing_parameters(pkey)) !EVP_PKEY_missing_parameters(pkey))
EVP_PKEY_copy_parameters(pktmp,pkey); EVP_PKEY_copy_parameters(pktmp,pkey);
EVP_PKEY_free(pktmp); EVP_PKEY_free(pktmp);
@ -2110,106 +2110,106 @@ static int add_oid_section(LHASH *hconf)
static int do_revoke(X509 *x509, TXT_DB *db) static int do_revoke(X509 *x509, TXT_DB *db)
{ {
ASN1_UTCTIME *tm=NULL; ASN1_UTCTIME *tm=NULL;
char *row[DB_NUMBER],**rrow,**irow; char *row[DB_NUMBER],**rrow,**irow;
int ok=-1,i; int ok=-1,i;
for (i=0; i<DB_NUMBER; i++) for (i=0; i<DB_NUMBER; i++)
row[i]=NULL; row[i]=NULL;
row[DB_name]=X509_NAME_oneline(x509->cert_info->subject,NULL,0); row[DB_name]=X509_NAME_oneline(x509->cert_info->subject,NULL,0);
row[DB_serial]=BN_bn2hex(ASN1_INTEGER_to_BN(x509->cert_info->serialNumber,NULL)); row[DB_serial]=BN_bn2hex(ASN1_INTEGER_to_BN(x509->cert_info->serialNumber,NULL));
if ((row[DB_name] == NULL) || (row[DB_serial] == NULL)) if ((row[DB_name] == NULL) || (row[DB_serial] == NULL))
{ {
BIO_printf(bio_err,"Malloc failure\n"); BIO_printf(bio_err,"Malloc failure\n");
goto err; goto err;
} }
rrow=TXT_DB_get_by_index(db,DB_name,row); rrow=TXT_DB_get_by_index(db,DB_name,row);
if (rrow == NULL) if (rrow == NULL)
{ {
BIO_printf(bio_err,"Adding Entry to DB for %s\n", row[DB_name]); BIO_printf(bio_err,"Adding Entry to DB for %s\n", row[DB_name]);
/* We now just add it to the database */ /* We now just add it to the database */
row[DB_type]=(char *)Malloc(2); row[DB_type]=(char *)Malloc(2);
tm=X509_get_notAfter(x509); tm=X509_get_notAfter(x509);
row[DB_exp_date]=(char *)Malloc(tm->length+1); row[DB_exp_date]=(char *)Malloc(tm->length+1);
memcpy(row[DB_exp_date],tm->data,tm->length); memcpy(row[DB_exp_date],tm->data,tm->length);
row[DB_exp_date][tm->length]='\0'; row[DB_exp_date][tm->length]='\0';
row[DB_rev_date]=NULL; row[DB_rev_date]=NULL;
/* row[DB_serial] done already */ /* row[DB_serial] done already */
row[DB_file]=(char *)Malloc(8); row[DB_file]=(char *)Malloc(8);
/* row[DB_name] done already */ /* row[DB_name] done already */
if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) || if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) ||
(row[DB_file] == NULL)) (row[DB_file] == NULL))
{ {
BIO_printf(bio_err,"Malloc failure\n"); BIO_printf(bio_err,"Malloc failure\n");
goto err; goto err;
} }
strcpy(row[DB_file],"unknown"); strcpy(row[DB_file],"unknown");
row[DB_type][0]='V'; row[DB_type][0]='V';
row[DB_type][1]='\0'; row[DB_type][1]='\0';
if ((irow=(char **)Malloc(sizeof(char *)*(DB_NUMBER+1))) == NULL) if ((irow=(char **)Malloc(sizeof(char *)*(DB_NUMBER+1))) == NULL)
{ {
BIO_printf(bio_err,"Malloc failure\n"); BIO_printf(bio_err,"Malloc failure\n");
goto err; goto err;
} }
for (i=0; i<DB_NUMBER; i++) for (i=0; i<DB_NUMBER; i++)
{ {
irow[i]=row[i]; irow[i]=row[i];
row[i]=NULL; row[i]=NULL;
} }
irow[DB_NUMBER]=NULL; irow[DB_NUMBER]=NULL;
if (!TXT_DB_insert(db,irow)) if (!TXT_DB_insert(db,irow))
{ {
BIO_printf(bio_err,"failed to update database\n"); BIO_printf(bio_err,"failed to update database\n");
BIO_printf(bio_err,"TXT_DB error number %ld\n",db->error); BIO_printf(bio_err,"TXT_DB error number %ld\n",db->error);
goto err; goto err;
} }
/* Revoke Certificate */ /* Revoke Certificate */
do_revoke(x509,db); do_revoke(x509,db);
ok=1; ok=1;
goto err; goto err;
} }
else if (index_serial_cmp(row,rrow)) else if (index_serial_cmp(row,rrow))
{ {
BIO_printf(bio_err,"ERROR:no same serial number %s\n", BIO_printf(bio_err,"ERROR:no same serial number %s\n",
row[DB_serial]); row[DB_serial]);
goto err; goto err;
} }
else if (rrow[DB_type][0]=='R') else if (rrow[DB_type][0]=='R')
{ {
BIO_printf(bio_err,"ERROR:Already revoked, serial number %s\n", BIO_printf(bio_err,"ERROR:Already revoked, serial number %s\n",
row[DB_serial]); row[DB_serial]);
goto err; goto err;
} }
else else
{ {
BIO_printf(bio_err,"Revoking Certificate %s.\n", rrow[DB_serial]); BIO_printf(bio_err,"Revoking Certificate %s.\n", rrow[DB_serial]);
tm=X509_gmtime_adj(tm,0); tm=X509_gmtime_adj(tm,0);
rrow[DB_type][0]='R'; rrow[DB_type][0]='R';
rrow[DB_type][1]='\0'; rrow[DB_type][1]='\0';
rrow[DB_rev_date]=(char *)Malloc(tm->length+1); rrow[DB_rev_date]=(char *)Malloc(tm->length+1);
memcpy(rrow[DB_rev_date],tm->data,tm->length); memcpy(rrow[DB_rev_date],tm->data,tm->length);
rrow[DB_rev_date][tm->length]='\0'; rrow[DB_rev_date][tm->length]='\0';
} }
ok=1; ok=1;
err: err:
for (i=0; i<DB_NUMBER; i++) for (i=0; i<DB_NUMBER; i++)
{ {
if (row[i] != NULL) if (row[i] != NULL)
Free(row[i]); Free(row[i]);
} }
ASN1_UTCTIME_free(tm); ASN1_UTCTIME_free(tm);
return(ok); return(ok);
} }

View file

@ -83,7 +83,7 @@ int MAIN(int argc, char **argv)
BIO *bmd=NULL; BIO *bmd=NULL;
const char *name; const char *name;
#define PROG_NAME_SIZE 16 #define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE]; char pname[PROG_NAME_SIZE];
int separator=0; int separator=0;
int debug=0; int debug=0;
@ -99,7 +99,7 @@ int MAIN(int argc, char **argv)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
/* first check the program name */ /* first check the program name */
program_name(argv[0],pname,PROG_NAME_SIZE); program_name(argv[0],pname,PROG_NAME_SIZE);
md=EVP_get_digestbyname(pname); md=EVP_get_digestbyname(pname);

View file

@ -94,7 +94,7 @@ int MAIN(int argc, char **argv)
char *inf=NULL,*outf=NULL; char *inf=NULL,*outf=NULL;
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL; BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
#define PROG_NAME_SIZE 16 #define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE]; char pname[PROG_NAME_SIZE];
apps_startup(); apps_startup();
@ -103,7 +103,7 @@ int MAIN(int argc, char **argv)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
/* first check the program name */ /* first check the program name */
program_name(argv[0],pname,PROG_NAME_SIZE); program_name(argv[0],pname,PROG_NAME_SIZE);
if (strcmp(pname,"base64") == 0) if (strcmp(pname,"base64") == 0)
base64=1; base64=1;

View file

@ -99,9 +99,9 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "Netscape certificate sequence utility\n"); BIO_printf (bio_err, "Netscape certificate sequence utility\n");
BIO_printf (bio_err, "Usage nseq [options]\n"); BIO_printf (bio_err, "Usage nseq [options]\n");
BIO_printf (bio_err, "where options are\n"); BIO_printf (bio_err, "where options are\n");
BIO_printf (bio_err, "-in file input file\n"); BIO_printf (bio_err, "-in file input file\n");
BIO_printf (bio_err, "-out file output file\n"); BIO_printf (bio_err, "-out file output file\n");
BIO_printf (bio_err, "-toseq output NS Sequence file\n"); BIO_printf (bio_err, "-toseq output NS Sequence file\n");
EXIT(1); EXIT(1);
} }
@ -160,15 +160,15 @@ end:
static int dump_cert_text(BIO *out, X509 *x) static int dump_cert_text(BIO *out, X509 *x)
{ {
char buf[256]; char buf[256];
X509_NAME_oneline(X509_get_subject_name(x),buf,256); X509_NAME_oneline(X509_get_subject_name(x),buf,256);
BIO_puts(out,"subject="); BIO_puts(out,"subject=");
BIO_puts(out,buf); BIO_puts(out,buf);
X509_NAME_oneline(X509_get_issuer_name(x),buf,256); X509_NAME_oneline(X509_get_issuer_name(x),buf,256);
BIO_puts(out,"\nissuer= "); BIO_puts(out,"\nissuer= ");
BIO_puts(out,buf); BIO_puts(out,buf);
BIO_puts(out,"\n"); BIO_puts(out,"\n");
return 0; return 0;
} }

View file

@ -117,7 +117,7 @@ int BIO_free(BIO *a)
#ifdef REF_PRINT #ifdef REF_PRINT
REF_PRINT("BIO",a); REF_PRINT("BIO",a);
#endif #endif
if (i > 0) return(1); if (i > 0) return(1);
#ifdef REF_CHECK #ifdef REF_CHECK
if (i < 0) if (i < 0)
{ {
@ -434,9 +434,9 @@ BIO *BIO_dup_chain(BIO *in)
goto err; goto err;
} }
/* copy app data */ /* copy app data */
if (!CRYPTO_dup_ex_data(bio_meth,&new->ex_data,&bio->ex_data)) if (!CRYPTO_dup_ex_data(bio_meth,&new->ex_data,&bio->ex_data))
goto err; goto err;
if (ret == NULL) if (ret == NULL)
{ {
@ -464,11 +464,11 @@ void BIO_copy_next_retry(BIO *b)
int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(),
int (*dup_func)(), void (*free_func)()) int (*dup_func)(), void (*free_func)())
{ {
bio_meth_num++; bio_meth_num++;
return(CRYPTO_get_ex_new_index(bio_meth_num-1,&bio_meth, return(CRYPTO_get_ex_new_index(bio_meth_num-1,&bio_meth,
argl,argp,new_func,dup_func,free_func)); argl,argp,new_func,dup_func,free_func));
} }
int BIO_set_ex_data(BIO *bio, int idx, char *data) int BIO_set_ex_data(BIO *bio, int idx, char *data)
{ {

View file

@ -292,7 +292,7 @@ static int acpt_read(BIO *b, char *out, int outl)
int ret=0; int ret=0;
BIO_ACCEPT *data; BIO_ACCEPT *data;
BIO_clear_retry_flags(b); BIO_clear_retry_flags(b);
data=(BIO_ACCEPT *)b->ptr; data=(BIO_ACCEPT *)b->ptr;
while (b->next_bio == NULL) while (b->next_bio == NULL)

View file

@ -72,7 +72,7 @@ const char *SSLeay_version(int t)
static char buf[sizeof(DATE)+11]; static char buf[sizeof(DATE)+11];
sprintf(buf,"built on: %s",DATE); sprintf(buf,"built on: %s",DATE);
return(buf); return(buf);
#else #else
return("built on: date not available"); return("built on: date not available");
#endif #endif

View file

@ -476,11 +476,11 @@ static int noecho_fgets(char *buf, int size, FILE *tty)
* usually a CR so this can be trouble. No STDIO fix seems to work but * usually a CR so this can be trouble. No STDIO fix seems to work but
* flushing the console appears to do the trick. * flushing the console appears to do the trick.
*/ */
{ {
HANDLE inh; HANDLE inh;
inh = GetStdHandle(STD_INPUT_HANDLE); inh = GetStdHandle(STD_INPUT_HANDLE);
FlushConsoleInputBuffer(inh); FlushConsoleInputBuffer(inh);
} }
#endif #endif
return(strlen(buf)); return(strlen(buf));
} }

View file

@ -212,8 +212,8 @@ end:
/* We now need to gernerate g */ /* We now need to gernerate g */
/* Set r0=(p-1)/q */ /* Set r0=(p-1)/q */
BN_sub(test,p,BN_value_one()); BN_sub(test,p,BN_value_one());
BN_div(r0,NULL,test,q,ctx); BN_div(r0,NULL,test,q,ctx);
BN_set_word(test,h); BN_set_word(test,h);
BN_MONT_CTX_set(mont,p,ctx); BN_MONT_CTX_set(mont,p,ctx);

View file

@ -601,7 +601,7 @@ void ERR_set_error_data(char *data, int flags)
} }
void ERR_add_error_data(int num, ...) void ERR_add_error_data(int num, ...)
{ {
va_list args; va_list args;
int i,n,s; int i,n,s;
char *str,*p,*a; char *str,*p,*a;

View file

@ -523,7 +523,7 @@ static void block_in(BIO* b)
{ {
BIO_OK_CTX *ctx; BIO_OK_CTX *ctx;
EVP_MD_CTX *md; EVP_MD_CTX *md;
long tl= 0; long tl= 0;
unsigned char tmp[EVP_MAX_MD_SIZE]; unsigned char tmp[EVP_MAX_MD_SIZE];
ctx=(BIO_OK_CTX *)b->ptr; ctx=(BIO_OK_CTX *)b->ptr;

View file

@ -336,8 +336,8 @@ void CRYPTO_mem_leaks(BIO *b)
#if 0 #if 0
lh_stats_bio(mh,b); lh_stats_bio(mh,b);
lh_node_stats_bio(mh,b); lh_node_stats_bio(mh,b);
lh_node_usage_stats_bio(mh,b); lh_node_usage_stats_bio(mh,b);
#endif #endif
} }

View file

@ -77,7 +77,7 @@ static SSL_METHOD SSLv23_data= {
ssl_undefined_function, ssl_undefined_function,
ssl_undefined_function, ssl_undefined_function,
ssl23_read, ssl23_read,
(int (*)(struct ssl_st *, char *, int))ssl_undefined_function, (int (*)(struct ssl_st *, char *, int))ssl_undefined_function,
ssl23_write, ssl23_write,
ssl_undefined_function, ssl_undefined_function,
ssl_undefined_function, ssl_undefined_function,

View file

@ -757,7 +757,7 @@ static int ssl3_get_server_certificate(SSL *s)
} }
i=ssl_verify_cert_chain(s,sk); i=ssl_verify_cert_chain(s,sk);
if ((s->verify_mode != SSL_VERIFY_NONE) && (!i)) if ((s->verify_mode != SSL_VERIFY_NONE) && (!i))
{ {
al=ssl_verify_alarm_type(s->verify_result); al=ssl_verify_alarm_type(s->verify_result);
SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED); SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED);

View file

@ -71,14 +71,14 @@ int SSL_library_init(void)
EVP_add_cipher(EVP_idea_cbc()); EVP_add_cipher(EVP_idea_cbc());
#endif #endif
#ifndef NO_RC4 #ifndef NO_RC4
EVP_add_cipher(EVP_rc4()); EVP_add_cipher(EVP_rc4());
#endif #endif
#ifndef NO_RC2 #ifndef NO_RC2
EVP_add_cipher(EVP_rc2_cbc()); EVP_add_cipher(EVP_rc2_cbc());
#endif #endif
#ifndef NO_MD2 #ifndef NO_MD2
EVP_add_digest(EVP_md2()); EVP_add_digest(EVP_md2());
#endif #endif
#ifndef NO_MD5 #ifndef NO_MD5
EVP_add_digest(EVP_md5()); EVP_add_digest(EVP_md5());

View file

@ -614,7 +614,7 @@ err:
char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len) char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
{ {
int is_export,pkl,kl; int is_export,pkl,kl;
char *ver,*exp; char *ver,*exp;
char *kx,*au,*enc,*mac; char *kx,*au,*enc,*mac;
unsigned long alg,alg2; unsigned long alg,alg2;
@ -623,10 +623,10 @@ char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
alg=cipher->algorithms; alg=cipher->algorithms;
alg2=cipher->algorithm2; alg2=cipher->algorithm2;
is_export=SSL_IS_EXPORT(alg); is_export=SSL_IS_EXPORT(alg);
pkl=SSL_EXPORT_PKEYLENGTH(alg); pkl=SSL_EXPORT_PKEYLENGTH(alg);
kl=SSL_EXPORT_KEYLENGTH(alg); kl=SSL_EXPORT_KEYLENGTH(alg);
exp=is_export?" export":""; exp=is_export?" export":"";
if (alg & SSL_SSLV2) if (alg & SSL_SSLV2)
ver="SSLv2"; ver="SSLv2";
@ -638,7 +638,7 @@ char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
switch (alg&SSL_MKEY_MASK) switch (alg&SSL_MKEY_MASK)
{ {
case SSL_kRSA: case SSL_kRSA:
kx=is_export?(pkl == 512 ? "RSA(512)" : "RSA(1024)"):"RSA"; kx=is_export?(pkl == 512 ? "RSA(512)" : "RSA(1024)"):"RSA";
break; break;
case SSL_kDHr: case SSL_kDHr:
kx="DH/RSA"; kx="DH/RSA";
@ -650,7 +650,7 @@ char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
kx="Fortezza"; kx="Fortezza";
break; break;
case SSL_kEDH: case SSL_kEDH:
kx=is_export?(pkl == 512 ? "DH(512)" : "DH(1024)"):"DH"; kx=is_export?(pkl == 512 ? "DH(512)" : "DH(1024)"):"DH";
break; break;
default: default:
kx="unknown"; kx="unknown";
@ -679,17 +679,17 @@ char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
switch (alg&SSL_ENC_MASK) switch (alg&SSL_ENC_MASK)
{ {
case SSL_DES: case SSL_DES:
enc=(is_export && kl == 5)?"DES(40)":"DES(56)"; enc=(is_export && kl == 5)?"DES(40)":"DES(56)";
break; break;
case SSL_3DES: case SSL_3DES:
enc="3DES(168)"; enc="3DES(168)";
break; break;
case SSL_RC4: case SSL_RC4:
enc=is_export?(kl == 5 ? "RC4(40)" : "RC4(56)") enc=is_export?(kl == 5 ? "RC4(40)" : "RC4(56)")
:((alg2&SSL2_CF_8_BYTE_ENC)?"RC4(64)":"RC4(128)"); :((alg2&SSL2_CF_8_BYTE_ENC)?"RC4(64)":"RC4(128)");
break; break;
case SSL_RC2: case SSL_RC2:
enc=is_export?(kl == 5 ? "RC2(40)" : "RC2(56)"):"RC2(128)"; enc=is_export?(kl == 5 ? "RC2(40)" : "RC2(56)"):"RC2(128)";
break; break;
case SSL_IDEA: case SSL_IDEA:
enc="IDEA(128)"; enc="IDEA(128)";

View file

@ -1524,7 +1524,7 @@ SSL *SSL_dup(SSL *s)
{ {
STACK_OF(X509_NAME) *sk; STACK_OF(X509_NAME) *sk;
X509_NAME *xn; X509_NAME *xn;
SSL *ret; SSL *ret;
int i; int i;
if ((ret=SSL_new(SSL_get_SSL_CTX(s))) == NULL) if ((ret=SSL_new(SSL_get_SSL_CTX(s))) == NULL)
@ -1674,9 +1674,9 @@ EVP_PKEY *SSL_get_privatekey(SSL *s)
SSL_CIPHER *SSL_get_current_cipher(SSL *s) SSL_CIPHER *SSL_get_current_cipher(SSL *s)
{ {
if ((s->session != NULL) && (s->session->cipher != NULL)) if ((s->session != NULL) && (s->session->cipher != NULL))
return(s->session->cipher); return(s->session->cipher);
return(NULL); return(NULL);
} }
int ssl_init_wbio_buffer(SSL *s,int push) int ssl_init_wbio_buffer(SSL *s,int push)
@ -1814,11 +1814,11 @@ long SSL_get_verify_result(SSL *ssl)
int SSL_get_ex_new_index(long argl,char *argp,int (*new_func)(), int SSL_get_ex_new_index(long argl,char *argp,int (*new_func)(),
int (*dup_func)(),void (*free_func)()) int (*dup_func)(),void (*free_func)())
{ {
ssl_meth_num++; ssl_meth_num++;
return(CRYPTO_get_ex_new_index(ssl_meth_num-1, return(CRYPTO_get_ex_new_index(ssl_meth_num-1,
&ssl_meth,argl,argp,new_func,dup_func,free_func)); &ssl_meth,argl,argp,new_func,dup_func,free_func));
} }
int SSL_set_ex_data(SSL *s,int idx,void *arg) int SSL_set_ex_data(SSL *s,int idx,void *arg)
{ {
@ -1832,11 +1832,11 @@ void *SSL_get_ex_data(SSL *s,int idx)
int SSL_CTX_get_ex_new_index(long argl,char *argp,int (*new_func)(), int SSL_CTX_get_ex_new_index(long argl,char *argp,int (*new_func)(),
int (*dup_func)(),void (*free_func)()) int (*dup_func)(),void (*free_func)())
{ {
ssl_ctx_meth_num++; ssl_ctx_meth_num++;
return(CRYPTO_get_ex_new_index(ssl_ctx_meth_num-1, return(CRYPTO_get_ex_new_index(ssl_ctx_meth_num-1,
&ssl_ctx_meth,argl,argp,new_func,dup_func,free_func)); &ssl_ctx_meth,argl,argp,new_func,dup_func,free_func));
} }
int SSL_CTX_set_ex_data(SSL_CTX *s,int idx,void *arg) int SSL_CTX_set_ex_data(SSL_CTX *s,int idx,void *arg)
{ {

View file

@ -74,12 +74,12 @@ SSL_SESSION *SSL_get_session(SSL *ssl)
int SSL_SESSION_get_ex_new_index(long argl, char *argp, int (*new_func)(), int SSL_SESSION_get_ex_new_index(long argl, char *argp, int (*new_func)(),
int (*dup_func)(), void (*free_func)()) int (*dup_func)(), void (*free_func)())
{ {
ssl_session_num++; ssl_session_num++;
return(CRYPTO_get_ex_new_index(ssl_session_num-1, return(CRYPTO_get_ex_new_index(ssl_session_num-1,
&ssl_session_meth, &ssl_session_meth,
argl,argp,new_func,dup_func,free_func)); argl,argp,new_func,dup_func,free_func));
} }
int SSL_SESSION_set_ex_data(SSL_SESSION *s, int idx, void *arg) int SSL_SESSION_set_ex_data(SSL_SESSION *s, int idx, void *arg)
{ {

View file

@ -62,20 +62,20 @@
#ifndef NO_FP_API #ifndef NO_FP_API
int SSL_SESSION_print_fp(FILE *fp, SSL_SESSION *x) int SSL_SESSION_print_fp(FILE *fp, SSL_SESSION *x)
{ {
BIO *b; BIO *b;
int ret; int ret;
if ((b=BIO_new(BIO_s_file_internal())) == NULL) if ((b=BIO_new(BIO_s_file_internal())) == NULL)
{ {
SSLerr(SSL_F_SSL_SESSION_PRINT_FP,ERR_R_BUF_LIB); SSLerr(SSL_F_SSL_SESSION_PRINT_FP,ERR_R_BUF_LIB);
return(0); return(0);
} }
BIO_set_fp(b,fp,BIO_NOCLOSE); BIO_set_fp(b,fp,BIO_NOCLOSE);
ret=SSL_SESSION_print(b,x); ret=SSL_SESSION_print(b,x);
BIO_free(b); BIO_free(b);
return(ret); return(ret);
} }
#endif #endif
int SSL_SESSION_print(BIO *bp, SSL_SESSION *x) int SSL_SESSION_print(BIO *bp, SSL_SESSION *x)