Use SHA256 not MD5 as default digest.
[openssl.git] / apps / sess_id.c
index cfecd86a50030f3a3377944297d8f273ffa195a0..39711e2150e821dcf440e6c0cac6fb8f8a496562 100644 (file)
@@ -160,10 +160,7 @@ int sess_id_main(int argc, char **argv)
     }
 
     if (!noout || text) {
-        const char* modeflag = "w";
-        if (outformat == FORMAT_ASN1 || outformat == FORMAT_NSS)
-            modeflag = "wb";
-        out = bio_open_default(outfile, modeflag);
+        out = bio_open_default(outfile, 'w', outformat);
         if (out == NULL)
             goto end;
     }
@@ -211,8 +208,7 @@ int sess_id_main(int argc, char **argv)
     ret = 0;
  end:
     BIO_free_all(out);
-    if (x != NULL)
-        SSL_SESSION_free(x);
+    SSL_SESSION_free(x);
     return (ret);
 }
 
@@ -221,7 +217,7 @@ static SSL_SESSION *load_sess_id(char *infile, int format)
     SSL_SESSION *x = NULL;
     BIO *in = NULL;
 
-    in = bio_open_default(infile, RB(format));
+    in = bio_open_default(infile, 'r', format);
     if (in == NULL)
         goto end;
     if (format == FORMAT_ASN1)