Updates to s_client and s_server to remove the constant 28 (for IPv4 header
[oweals/openssl.git] / apps / s_cb.c
index b20d632b11c8119b7ed9afa30917f2059b5dfa91..4b0e85d85d9b83dd3654b7d2990e8cf75bfba64d 100644 (file)
@@ -880,9 +880,6 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
                                case 20:
                                        str_details1 = ", Finished";
                                        break;
-                               case 23:
-                                       str_details1 = ", SupplementalData";
-                                       break;
                                        }
                                }
                        }
@@ -1253,7 +1250,7 @@ struct chain_flags chain_flags_list[] =
        };
 
 
-static void print_chain_flags(BIO *out, int flags)
+static void print_chain_flags(BIO *out, SSL *s, int flags)
        {
        struct chain_flags *ctmp = chain_flags_list;
        while(ctmp->name)
@@ -1262,6 +1259,11 @@ static void print_chain_flags(BIO *out, int flags)
                                flags & ctmp->flag ? "OK" : "NOT OK");
                ctmp++;
                }
+       BIO_printf(out, "\tSuite B: ");
+       if (SSL_set_cert_flags(s, 0) & SSL_CERT_FLAG_SUITEB_128_LOS)
+               BIO_puts(out, flags & CERT_PKEY_SUITEB ? "OK\n" : "NOT OK\n");
+       else
+               BIO_printf(out, "not tested\n");
        }
 
 /* Very basic selection callback: just use any certificate chain
@@ -1304,7 +1306,7 @@ static int set_cert_cb(SSL *ssl, void *arg)
                                                        XN_FLAG_ONELINE);
                BIO_puts(bio_err, "\n");
                
-               print_chain_flags(bio_err, rv);
+               print_chain_flags(bio_err, ssl, rv);
                if (rv & CERT_PKEY_VALID)
                        {
                        SSL_use_certificate(ssl, exc->cert);
@@ -1405,9 +1407,15 @@ int load_excert(SSL_EXCERT **pexc, BIO *err)
                if (!exc->cert)
                        return 0;
                if (exc->keyfile)
-                       exc->keyfile = exc->certfile;
-               exc->key = load_key(err, exc->certfile, exc->certform, 0,
-                                       NULL, NULL, "Server Certificate");
+                       {
+                       exc->key = load_key(err, exc->keyfile, exc->keyform,
+                                           0, NULL, NULL, "Server Key");
+                       }
+               else
+                       {
+                       exc->key = load_key(err, exc->certfile, exc->certform,
+                                           0, NULL, NULL, "Server Key");
+                       }
                if (!exc->key)
                        return 0;
                if (exc->chainfile)
@@ -1416,7 +1424,7 @@ int load_excert(SSL_EXCERT **pexc, BIO *err)
                                                exc->chainfile, FORMAT_PEM,
                                                NULL, NULL,
                                                "Server Chain");
-                       if (!exc->chainfile)
+                       if (!exc->chain)
                                return 0;
                        }
                }