Add an NSS output format to sess_id to export to export the session id and the master...
[openssl.git] / apps / sess_id.c
index b16686c26df671ecf2d778d600a58ea2679d7816..d4bf1afe2db1450c796588277a3c5fb3673e55d0 100644 (file)
@@ -73,7 +73,7 @@ static const char *sess_id_usage[]={
 "usage: sess_id args\n",
 "\n",
 " -inform arg     - input format - default PEM (DER or PEM)\n",
 "usage: sess_id args\n",
 "\n",
 " -inform arg     - input format - default PEM (DER or PEM)\n",
-" -outform arg    - output format - default PEM\n",
+" -outform arg    - output format - default PEM (PEM, DER or NSS)\n",
 " -in arg         - input file - default stdin\n",
 " -out arg        - output file - default stdout\n",
 " -text           - print ssl session id details\n",
 " -in arg         - input file - default stdin\n",
 " -out arg        - output file - default stdout\n",
 " -text           - print ssl session id details\n",
@@ -246,6 +246,8 @@ bad:
                        i=i2d_SSL_SESSION_bio(out,x);
                else if (outformat == FORMAT_PEM)
                        i=PEM_write_bio_SSL_SESSION(out,x);
                        i=i2d_SSL_SESSION_bio(out,x);
                else if (outformat == FORMAT_PEM)
                        i=PEM_write_bio_SSL_SESSION(out,x);
+               else if (outformat == FORMAT_NSS)
+                       i=SSL_SESSION_print_keylog(out,x);
                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;