2016-05-17 18:18:30 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
1998-12-21 10:52:47 +00:00
|
|
|
*
|
2016-05-17 18:18:30 +00:00
|
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
1998-12-21 10:52:47 +00:00
|
|
|
*/
|
2016-05-17 18:18:30 +00:00
|
|
|
|
2006-03-10 23:06:27 +00:00
|
|
|
/* ====================================================================
|
|
|
|
* Copyright 2005 Nokia. All rights reserved.
|
|
|
|
*
|
|
|
|
* The portions of the attached software ("Contribution") is developed by
|
|
|
|
* Nokia Corporation and is licensed pursuant to the OpenSSL open source
|
|
|
|
* license.
|
|
|
|
*
|
|
|
|
* The Contribution, originally written by Mika Kousa and Pasi Eronen of
|
|
|
|
* Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
|
|
|
|
* support (see RFC 4279) to OpenSSL.
|
|
|
|
*
|
|
|
|
* No patent licenses or other rights except those expressly stated in
|
|
|
|
* the OpenSSL open source license shall be deemed granted or received
|
|
|
|
* expressly, by implication, estoppel, or otherwise.
|
|
|
|
*
|
|
|
|
* No assurances are provided by Nokia that the Contribution does not
|
|
|
|
* infringe the patent or other intellectual property rights of any third
|
|
|
|
* party or that the license provides you with all the necessary rights
|
|
|
|
* to make use of the Contribution.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
|
|
|
|
* ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
|
|
|
|
* SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
|
|
|
|
* OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
|
|
|
|
* OTHERWISE.
|
|
|
|
*/
|
1998-12-21 10:52:47 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "ssl_locl.h"
|
|
|
|
|
2002-01-12 15:56:13 +00:00
|
|
|
const char *SSL_state_string_long(const SSL *s)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2016-03-22 14:52:13 +00:00
|
|
|
if (ossl_statem_in_error(s))
|
2015-09-08 08:13:50 +00:00
|
|
|
return "error";
|
|
|
|
|
2015-10-05 09:49:15 +00:00
|
|
|
switch (SSL_get_state(s)) {
|
2016-09-07 19:40:16 +00:00
|
|
|
case TLS_ST_CR_CERT_STATUS:
|
|
|
|
return "SSLv3/TLS read certificate status";
|
|
|
|
case TLS_ST_CW_NEXT_PROTO:
|
|
|
|
return "SSLv3/TLS write next proto";
|
|
|
|
case TLS_ST_SR_NEXT_PROTO:
|
|
|
|
return "SSLv3/TLS write next proto";
|
|
|
|
case TLS_ST_SW_CERT_STATUS:
|
|
|
|
return "SSLv3/TLS write next proto";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_BEFORE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "before SSL initialization";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_OK:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSL negotiation finished successfully";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_CLNT_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write client hello";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_SRVR_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read server hello";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read server certificate";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read server key exchange";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_CERT_REQ:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read server certificate request";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_SESSION_TICKET:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read server session ticket";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_SRVR_DONE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read server done";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write client certificate";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write client key exchange";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_CERT_VRFY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write certificate verify";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_CHANGE:
|
|
|
|
case TLS_ST_SW_CHANGE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write change cipher spec";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_FINISHED:
|
|
|
|
case TLS_ST_SW_FINISHED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write finished";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_CHANGE:
|
|
|
|
case TLS_ST_SR_CHANGE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read change cipher spec";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_FINISHED:
|
|
|
|
case TLS_ST_SR_FINISHED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read finished";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_CLNT_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read client hello";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_HELLO_REQ:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write hello request";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_SRVR_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write server hello";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write certificate";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write key exchange";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_CERT_REQ:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write certificate request";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_SESSION_TICKET:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write session ticket";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_SRVR_DONE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS write server done";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read client certificate";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read client key exchange";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_CERT_VRFY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLv3/TLS read certificate verify";
|
2015-09-08 08:13:50 +00:00
|
|
|
case DTLS_ST_CR_HELLO_VERIFY_REQUEST:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "DTLS1 read hello verify request";
|
2015-09-08 08:13:50 +00:00
|
|
|
case DTLS_ST_SW_HELLO_VERIFY_REQUEST:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "DTLS1 write hello verify request";
|
2015-01-22 03:40:55 +00:00
|
|
|
default:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unknown state";
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2002-01-12 15:56:13 +00:00
|
|
|
const char *SSL_state_string(const SSL *s)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2016-03-22 14:52:13 +00:00
|
|
|
if (ossl_statem_in_error(s))
|
2015-09-08 08:13:50 +00:00
|
|
|
return "SSLERR";
|
|
|
|
|
2015-10-05 09:49:15 +00:00
|
|
|
switch (SSL_get_state(s)) {
|
2016-09-07 19:40:16 +00:00
|
|
|
case TLS_ST_SR_NEXT_PROTO:
|
|
|
|
return "TRNP";
|
|
|
|
case TLS_ST_SW_SESSION_TICKET:
|
|
|
|
return "TWST";
|
|
|
|
case TLS_ST_SW_CERT_STATUS:
|
|
|
|
return "TWCS";
|
|
|
|
case TLS_ST_CR_CERT_STATUS:
|
|
|
|
return "TRCS";
|
|
|
|
case TLS_ST_CR_SESSION_TICKET:
|
|
|
|
return "TRST";
|
|
|
|
case TLS_ST_CW_NEXT_PROTO:
|
|
|
|
return "TWNP";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_BEFORE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "PINIT ";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_OK:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "SSLOK ";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_CLNT_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWCH";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_SRVR_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRSH";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRSC";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRSKE";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_CERT_REQ:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRCR";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CR_SRVR_DONE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRSD";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWCC";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWCKE";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_CW_CERT_VRFY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWCV";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_CHANGE:
|
|
|
|
case TLS_ST_CW_CHANGE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWCCS";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_FINISHED:
|
|
|
|
case TLS_ST_CW_FINISHED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWFIN";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_CHANGE:
|
|
|
|
case TLS_ST_CR_CHANGE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRCCS";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_FINISHED:
|
|
|
|
case TLS_ST_CR_FINISHED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRFIN";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_HELLO_REQ:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWHR";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_CLNT_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRCH";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_SRVR_HELLO:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWSH";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWSC";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWSKE";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_CERT_REQ:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWCR";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SW_SRVR_DONE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TWSD";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_CERT:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRCC";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_KEY_EXCH:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRCKE";
|
2015-09-08 08:13:50 +00:00
|
|
|
case TLS_ST_SR_CERT_VRFY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "TRCV";
|
2015-09-08 08:13:50 +00:00
|
|
|
case DTLS_ST_CR_HELLO_VERIFY_REQUEST:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "DRCHV";
|
2015-09-08 08:13:50 +00:00
|
|
|
case DTLS_ST_SW_HELLO_VERIFY_REQUEST:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "DWCHV";
|
2015-01-22 03:40:55 +00:00
|
|
|
default:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "UNKWN ";
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2001-08-23 17:22:43 +00:00
|
|
|
const char *SSL_alert_type_string_long(int value)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2016-03-22 14:52:13 +00:00
|
|
|
switch (value >> 8) {
|
|
|
|
case SSL3_AL_WARNING:
|
|
|
|
return "warning";
|
|
|
|
case SSL3_AL_FATAL:
|
|
|
|
return "fatal";
|
|
|
|
default:
|
|
|
|
return "unknown";
|
|
|
|
}
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2001-08-23 17:22:43 +00:00
|
|
|
const char *SSL_alert_type_string(int value)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2016-03-22 14:52:13 +00:00
|
|
|
switch (value >> 8) {
|
|
|
|
case SSL3_AL_WARNING:
|
|
|
|
return "W";
|
|
|
|
case SSL3_AL_FATAL:
|
|
|
|
return "F";
|
|
|
|
default:
|
|
|
|
return "U";
|
|
|
|
}
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2001-08-23 17:22:43 +00:00
|
|
|
const char *SSL_alert_desc_string(int value)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
|
|
|
switch (value & 0xff) {
|
|
|
|
case SSL3_AD_CLOSE_NOTIFY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "CN";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_UNEXPECTED_MESSAGE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "UM";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_BAD_RECORD_MAC:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "BM";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_DECOMPRESSION_FAILURE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "DF";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_HANDSHAKE_FAILURE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "HF";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_NO_CERTIFICATE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "NC";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_BAD_CERTIFICATE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "BC";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_UNSUPPORTED_CERTIFICATE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "UC";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_CERTIFICATE_REVOKED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "CR";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_CERTIFICATE_EXPIRED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "CE";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_CERTIFICATE_UNKNOWN:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "CU";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_ILLEGAL_PARAMETER:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "IP";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_DECRYPTION_FAILED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "DC";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_RECORD_OVERFLOW:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "RO";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNKNOWN_CA:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "CA";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_ACCESS_DENIED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "AD";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_DECODE_ERROR:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "DE";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_DECRYPT_ERROR:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "CY";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_EXPORT_RESTRICTION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "ER";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_PROTOCOL_VERSION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "PV";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_INSUFFICIENT_SECURITY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "IS";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_INTERNAL_ERROR:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "IE";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_USER_CANCELLED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "US";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_NO_RENEGOTIATION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "NR";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNSUPPORTED_EXTENSION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "UE";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_CERTIFICATE_UNOBTAINABLE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "CO";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNRECOGNIZED_NAME:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "UN";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "BR";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "BH";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNKNOWN_PSK_IDENTITY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "UP";
|
2015-01-22 03:40:55 +00:00
|
|
|
default:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "UK";
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2001-08-23 17:22:43 +00:00
|
|
|
const char *SSL_alert_desc_string_long(int value)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
|
|
|
switch (value & 0xff) {
|
|
|
|
case SSL3_AD_CLOSE_NOTIFY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "close notify";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_UNEXPECTED_MESSAGE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unexpected_message";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_BAD_RECORD_MAC:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "bad record mac";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_DECOMPRESSION_FAILURE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "decompression failure";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_HANDSHAKE_FAILURE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "handshake failure";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_NO_CERTIFICATE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "no certificate";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_BAD_CERTIFICATE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "bad certificate";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_UNSUPPORTED_CERTIFICATE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unsupported certificate";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_CERTIFICATE_REVOKED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "certificate revoked";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_CERTIFICATE_EXPIRED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "certificate expired";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_CERTIFICATE_UNKNOWN:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "certificate unknown";
|
2015-01-22 03:40:55 +00:00
|
|
|
case SSL3_AD_ILLEGAL_PARAMETER:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "illegal parameter";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_DECRYPTION_FAILED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "decryption failed";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_RECORD_OVERFLOW:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "record overflow";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNKNOWN_CA:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unknown CA";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_ACCESS_DENIED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "access denied";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_DECODE_ERROR:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "decode error";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_DECRYPT_ERROR:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "decrypt error";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_EXPORT_RESTRICTION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "export restriction";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_PROTOCOL_VERSION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "protocol version";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_INSUFFICIENT_SECURITY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "insufficient security";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_INTERNAL_ERROR:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "internal error";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_USER_CANCELLED:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "user canceled";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_NO_RENEGOTIATION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "no renegotiation";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNSUPPORTED_EXTENSION:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unsupported extension";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_CERTIFICATE_UNOBTAINABLE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "certificate unobtainable";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNRECOGNIZED_NAME:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unrecognized name";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "bad certificate status response";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "bad certificate hash value";
|
2015-01-22 03:40:55 +00:00
|
|
|
case TLS1_AD_UNKNOWN_PSK_IDENTITY:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unknown PSK identity";
|
2016-08-05 17:03:17 +00:00
|
|
|
case TLS1_AD_NO_APPLICATION_PROTOCOL:
|
2016-07-04 18:16:14 +00:00
|
|
|
return "no application protocol";
|
2015-01-22 03:40:55 +00:00
|
|
|
default:
|
2016-03-22 14:52:13 +00:00
|
|
|
return "unknown";
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
|
|
|
}
|