1052 | 1052 |
{
|
1053 | 1053 |
|
1054 | 1054 |
// Credit to Jared Stafford ([email protected])
|
1055 | |
char hello[] = {0x16,0x03,0x00,0x00,0xdc,0x01,0x00,0x00,0xd8,0x03,0x02,0x53,0x43,0x5b,0x90,0x9d,0x9b,0x72,0x0b,0xbc,0x0c,0xbc,0x2b,0x92,0xa8,0x48,0x97,0xcf,0xbd,0x39,0x04,0xcc,0x16,0x0a,0x85,0x03,0x90,0x9f,0x77,0x04,0x33,0xd4,0xde,0x00,0x00,0x66,0xc0,0x14,0xc0,0x0a,0xc0,0x22,0xc0,0x21,0x00,0x39,0x00,0x38,0x00,0x88,0x00,0x87,0xc0,0x0f,0xc0,0x05,0x00,0x35,0x00,0x84,0xc0,0x12,0xc0,0x08,0xc0,0x1c,0xc0,0x1b,0x00,0x16,0x00,0x13,0xc0,0x0d,0xc0,0x03,0x00,0x0a,0xc0,0x13,0xc0,0x09,0xc0,0x1f,0xc0,0x1e,0x00,0x33,0x00,0x32,0x00,0x9a,0x00,0x99,0x00,0x45,0x00,0x44,0xc0,0x0e,0xc0,0x04,0x00,0x2f,0x00,0x96,0x00,0x41,0xc0,0x11,0xc0,0x07,0xc0,0x0c,0xc0,0x02,0x00,0x05,0x00,0x04,0x00,0x15,0x00,0x12,0x00,0x09,0x00,0x14,0x00,0x11,0x00,0x08,0x00,0x06,0x00,0x03,0x00,0xff,0x01,0x00,0x00,0x49,0x00,0x0b,0x00,0x04,0x03,0x00,0x01,0x02,0x00,0x0a,0x00,0x34,0x00,0x32,0x00,0x0e,0x00,0x0d,0x00,0x19,0x00,0x0b,0x00,0x0c,0x00,0x18,0x00,0x09,0x00,0x0a,0x00,0x16,0x00,0x17,0x00,0x08,0x00,0x06,0x00,0x07,0x00,0x14,0x00,0x15,0x00,0x04,0x00,0x05,0x00,0x12,0x00,0x13,0x00,0x01,0x00,0x02,0x00,0x03,0x00,0x0f,0x00,0x10,0x00,0x11,0x00,0x23,0x00,0x00,0x00,0x0f,0x00,0x01,0x01};
|
|
1055 |
char hello[] = {0x16,0x03,0x01,0x00,0xdc,0x01,0x00,0x00,0xd8,0x03,0x00,0x53,0x43,0x5b,0x90,0x9d,0x9b,0x72,0x0b,0xbc,0x0c,0xbc,0x2b,0x92,0xa8,0x48,0x97,0xcf,0xbd,0x39,0x04,0xcc,0x16,0x0a,0x85,0x03,0x90,0x9f,0x77,0x04,0x33,0xd4,0xde,0x00,0x00,0x66,0xc0,0x14,0xc0,0x0a,0xc0,0x22,0xc0,0x21,0x00,0x39,0x00,0x38,0x00,0x88,0x00,0x87,0xc0,0x0f,0xc0,0x05,0x00,0x35,0x00,0x84,0xc0,0x12,0xc0,0x08,0xc0,0x1c,0xc0,0x1b,0x00,0x16,0x00,0x13,0xc0,0x0d,0xc0,0x03,0x00,0x0a,0xc0,0x13,0xc0,0x09,0xc0,0x1f,0xc0,0x1e,0x00,0x33,0x00,0x32,0x00,0x9a,0x00,0x99,0x00,0x45,0x00,0x44,0xc0,0x0e,0xc0,0x04,0x00,0x2f,0x00,0x96,0x00,0x41,0xc0,0x11,0xc0,0x07,0xc0,0x0c,0xc0,0x02,0x00,0x05,0x00,0x04,0x00,0x15,0x00,0x12,0x00,0x09,0x00,0x14,0x00,0x11,0x00,0x08,0x00,0x06,0x00,0x03,0x00,0xff,0x01,0x00,0x00,0x49,0x00,0x0b,0x00,0x04,0x03,0x00,0x01,0x02,0x00,0x0a,0x00,0x34,0x00,0x32,0x00,0x0e,0x00,0x0d,0x00,0x19,0x00,0x0b,0x00,0x0c,0x00,0x18,0x00,0x09,0x00,0x0a,0x00,0x16,0x00,0x17,0x00,0x08,0x00,0x06,0x00,0x07,0x00,0x14,0x00,0x15,0x00,0x04,0x00,0x05,0x00,0x12,0x00,0x13,0x00,0x01,0x00,0x02,0x00,0x03,0x00,0x0f,0x00,0x10,0x00,0x11,0x00,0x23,0x00,0x00,0x00,0x0f,0x00,0x01,0x01};
|
1056 | 1056 |
|
1057 | 1057 |
if (sslMethod == TLSv1_client_method())
|
1058 | 1058 |
{
|
1059 | |
hello[2] = 0x01;
|
|
1059 |
hello[10] = 0x01;
|
1060 | 1060 |
}
|
1061 | 1061 |
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
|
1062 | 1062 |
else if (sslMethod == TLSv1_1_client_method())
|
1063 | 1063 |
{
|
1064 | |
hello[2] = 0x02;
|
|
1064 |
hello[10] = 0x02;
|
1065 | 1065 |
}
|
1066 | 1066 |
else if (sslMethod == TLSv1_2_client_method())
|
1067 | 1067 |
{
|
1068 | |
hello[2] = 0x03;
|
|
1068 |
hello[10] = 0x03;
|
1069 | 1069 |
}
|
1070 | 1070 |
#endif
|
1071 | 1071 |
if (send(socketDescriptor, hello, sizeof(hello), 0) <= 0) {
|
|
1238 | 1238 |
uint32_t cipherid;
|
1239 | 1239 |
const SSL_CIPHER *sslCipherPointer;
|
1240 | 1240 |
const char *cleanSslMethod = printableSslMethod(sslMethod);
|
|
1241 |
struct timeval tval_start, tval_end, tval_elapsed;
|
|
1242 |
if (options->showTimes)
|
|
1243 |
{
|
|
1244 |
gettimeofday(&tval_start, NULL);
|
|
1245 |
}
|
|
1246 |
|
1241 | 1247 |
|
1242 | 1248 |
|
1243 | 1249 |
// Create request buffer...
|
|
1430 | 1436 |
{
|
1431 | 1437 |
ssl_print_tmp_key(options, ssl);
|
1432 | 1438 |
}
|
|
1439 |
// Timing
|
|
1440 |
if (options->showTimes)
|
|
1441 |
{
|
|
1442 |
int msec;
|
|
1443 |
gettimeofday(&tval_end, NULL);
|
|
1444 |
timersub(&tval_end, &tval_start, &tval_elapsed);
|
|
1445 |
msec = tval_elapsed.tv_sec * 1000 + (int)tval_elapsed.tv_usec/1000;
|
|
1446 |
printf("%s %dms%s", COL_GREY, msec, RESET);
|
|
1447 |
printf_xml(" time=\"%d\"", msec);
|
|
1448 |
}
|
|
1449 |
|
1433 | 1450 |
printf("\n");
|
1434 | 1451 |
printf_xml(" />\n");
|
1435 | 1452 |
|
|
1462 | 1479 |
// Could not connect
|
1463 | 1480 |
else
|
1464 | 1481 |
status = false;
|
|
1482 |
|
1465 | 1483 |
|
1466 | 1484 |
return status;
|
1467 | 1485 |
}
|
|
3116 | 3134 |
options.checkCertificate = true;
|
3117 | 3135 |
options.showClientCiphers = false;
|
3118 | 3136 |
options.showCipherIds = false;
|
|
3137 |
options.showTimes = false;
|
3119 | 3138 |
options.ciphersuites = true;
|
3120 | 3139 |
options.reneg = true;
|
3121 | 3140 |
options.compression = true;
|
|
3183 | 3202 |
else if (strcmp("--show-cipher-ids", argv[argLoop]) == 0)
|
3184 | 3203 |
{
|
3185 | 3204 |
options.showCipherIds = true;
|
|
3205 |
}
|
|
3206 |
|
|
3207 |
// Show handshake times
|
|
3208 |
else if (strcmp("--show-times", argv[argLoop]) == 0)
|
|
3209 |
{
|
|
3210 |
options.showTimes = true;
|
3186 | 3211 |
}
|
3187 | 3212 |
|
3188 | 3213 |
// Show client auth trusted CAs
|
|
3477 | 3502 |
printf(" %s--show-client-cas%s Show trusted CAs for TLS client auth\n", COL_GREEN, RESET);
|
3478 | 3503 |
printf(" %s--show-ciphers%s Show supported client ciphers\n", COL_GREEN, RESET);
|
3479 | 3504 |
printf(" %s--show-cipher-ids%s Show cipher ids\n", COL_GREEN, RESET);
|
|
3505 |
printf(" %s--show-times%s Show handhake times in milliseconds\n", COL_GREEN, RESET);
|
3480 | 3506 |
#ifndef OPENSSL_NO_SSL2
|
3481 | 3507 |
printf(" %s--ssl2%s Only check SSLv2 ciphers\n", COL_GREEN, RESET);
|
3482 | 3508 |
#endif
|