projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BC-32.pl: refresh Borland C support.
[oweals/openssl.git]
/
apps
/
sess_id.c
diff --git
a/apps/sess_id.c
b/apps/sess_id.c
index b99179f27679daa2b1d5085bd7089d9050b69cf0..b16686c26df671ecf2d778d600a58ea2679d7816 100644
(file)
--- a/
apps/sess_id.c
+++ b/
apps/sess_id.c
@@
-90,6
+90,7
@@
int MAIN(int, char **);
int MAIN(int argc, char **argv)
{
SSL_SESSION *x=NULL;
int MAIN(int argc, char **argv)
{
SSL_SESSION *x=NULL;
+ X509 *peer = NULL;
int ret=1,i,num,badops=0;
BIO *out=NULL;
int informat,outformat;
int ret=1,i,num,badops=0;
BIO *out=NULL;
int informat,outformat;
@@
-163,16
+164,17
@@
bad:
ERR_load_crypto_strings();
x=load_sess_id(infile,informat);
if (x == NULL) { goto end; }
ERR_load_crypto_strings();
x=load_sess_id(infile,informat);
if (x == NULL) { goto end; }
+ peer = SSL_SESSION_get0_peer(x);
if(context)
{
if(context)
{
-
x->sid_ctx_length=
strlen(context);
- if(
x->sid_ctx_length
> SSL_MAX_SID_CTX_LENGTH)
+
size_t ctx_len =
strlen(context);
+ if(
ctx_len
> SSL_MAX_SID_CTX_LENGTH)
{
BIO_printf(bio_err,"Context too long\n");
goto end;
}
{
BIO_printf(bio_err,"Context too long\n");
goto end;
}
-
memcpy(x->sid_ctx,context,x->sid_ctx_length
);
+
SSL_SESSION_set1_id_context(x, (unsigned char *)context, ctx_len
);
}
#ifdef undef
}
#ifdef undef
@@
-231,10
+233,10
@@
bad:
if (cert)
{
if (cert)
{
- if (
x->
peer == NULL)
+ if (peer == NULL)
BIO_puts(out,"No certificate present\n");
else
BIO_puts(out,"No certificate present\n");
else
- X509_print(out,
x->
peer);
+ X509_print(out,peer);
}
}
}
}
@@
-253,12
+255,12
@@
bad:
goto end;
}
}
goto end;
}
}
- else if (!noout && (
x->
peer != NULL)) /* just print the certificate */
+ else if (!noout && (peer != NULL)) /* just print the certificate */
{
if (outformat == FORMAT_ASN1)
{
if (outformat == FORMAT_ASN1)
- i=(int)i2d_X509_bio(out,
x->
peer);
+ i=(int)i2d_X509_bio(out,peer);
else if (outformat == FORMAT_PEM)
else if (outformat == FORMAT_PEM)
- i=PEM_write_bio_X509(out,
x->
peer);
+ i=PEM_write_bio_X509(out,peer);
else {
BIO_printf(bio_err,"bad output format specified for outfile\n");
goto end;
else {
BIO_printf(bio_err,"bad output format specified for outfile\n");
goto end;