SSL_alert_type_string.pod 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. =pod
  2. =head1 NAME
  3. SSL_alert_type_string, SSL_alert_type_string_long, SSL_alert_desc_string, SSL_alert_desc_string_long - get textual description of alert information
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. const char *SSL_alert_type_string(int value);
  7. const char *SSL_alert_type_string_long(int value);
  8. const char *SSL_alert_desc_string(int value);
  9. const char *SSL_alert_desc_string_long(int value);
  10. =head1 DESCRIPTION
  11. SSL_alert_type_string() returns a one letter string indicating the
  12. type of the alert specified by B<value>.
  13. SSL_alert_type_string_long() returns a string indicating the type of the alert
  14. specified by B<value>.
  15. SSL_alert_desc_string() returns a two letter string as a short form
  16. describing the reason of the alert specified by B<value>.
  17. SSL_alert_desc_string_long() returns a string describing the reason
  18. of the alert specified by B<value>.
  19. =head1 NOTES
  20. When one side of an SSL/TLS communication wants to inform the peer about
  21. a special situation, it sends an alert. The alert is sent as a special message
  22. and does not influence the normal data stream (unless its contents results
  23. in the communication being canceled).
  24. A warning alert is sent, when a non-fatal error condition occurs. The
  25. "close notify" alert is sent as a warning alert. Other examples for
  26. non-fatal errors are certificate errors ("certificate expired",
  27. "unsupported certificate"), for which a warning alert may be sent.
  28. (The sending party may however decide to send a fatal error.) The
  29. receiving side may cancel the connection on reception of a warning
  30. alert on it discretion.
  31. Several alert messages must be sent as fatal alert messages as specified
  32. by the TLS RFC. A fatal alert always leads to a connection abort.
  33. =head1 RETURN VALUES
  34. The following strings can occur for SSL_alert_type_string() or
  35. SSL_alert_type_string_long():
  36. =over 4
  37. =item "W"/"warning"
  38. =item "F"/"fatal"
  39. =item "U"/"unknown"
  40. This indicates that no support is available for this alert type.
  41. Probably B<value> does not contain a correct alert message.
  42. =back
  43. The following strings can occur for SSL_alert_desc_string() or
  44. SSL_alert_desc_string_long():
  45. =over 4
  46. =item "CN"/"close notify"
  47. The connection shall be closed. This is a warning alert.
  48. =item "UM"/"unexpected message"
  49. An inappropriate message was received. This alert is always fatal
  50. and should never be observed in communication between proper
  51. implementations.
  52. =item "BM"/"bad record mac"
  53. This alert is returned if a record is received with an incorrect
  54. MAC. This message is always fatal.
  55. =item "DF"/"decompression failure"
  56. The decompression function received improper input (e.g. data
  57. that would expand to excessive length). This message is always
  58. fatal.
  59. =item "HF"/"handshake failure"
  60. Reception of a handshake_failure alert message indicates that the
  61. sender was unable to negotiate an acceptable set of security
  62. parameters given the options available. This is a fatal error.
  63. =item "NC"/"no certificate"
  64. A client, that was asked to send a certificate, does not send a certificate
  65. (SSLv3 only).
  66. =item "BC"/"bad certificate"
  67. A certificate was corrupt, contained signatures that did not
  68. verify correctly, etc
  69. =item "UC"/"unsupported certificate"
  70. A certificate was of an unsupported type.
  71. =item "CR"/"certificate revoked"
  72. A certificate was revoked by its signer.
  73. =item "CE"/"certificate expired"
  74. A certificate has expired or is not currently valid.
  75. =item "CU"/"certificate unknown"
  76. Some other (unspecified) issue arose in processing the
  77. certificate, rendering it unacceptable.
  78. =item "IP"/"illegal parameter"
  79. A field in the handshake was out of range or inconsistent with
  80. other fields. This is always fatal.
  81. =item "DC"/"decryption failed"
  82. A TLSCiphertext decrypted in an invalid way: either it wasn't an
  83. even multiple of the block length or its padding values, when
  84. checked, weren't correct. This message is always fatal.
  85. =item "RO"/"record overflow"
  86. A TLSCiphertext record was received which had a length more than
  87. 2^14+2048 bytes, or a record decrypted to a TLSCompressed record
  88. with more than 2^14+1024 bytes. This message is always fatal.
  89. =item "CA"/"unknown CA"
  90. A valid certificate chain or partial chain was received, but the
  91. certificate was not accepted because the CA certificate could not
  92. be located or couldn't be matched with a known, trusted CA. This
  93. message is always fatal.
  94. =item "AD"/"access denied"
  95. A valid certificate was received, but when access control was
  96. applied, the sender decided not to proceed with negotiation.
  97. This message is always fatal.
  98. =item "DE"/"decode error"
  99. A message could not be decoded because some field was out of the
  100. specified range or the length of the message was incorrect. This
  101. message is always fatal.
  102. =item "CY"/"decrypt error"
  103. A handshake cryptographic operation failed, including being
  104. unable to correctly verify a signature, decrypt a key exchange,
  105. or validate a finished message.
  106. =item "ER"/"export restriction"
  107. A negotiation not in compliance with export restrictions was
  108. detected; for example, attempting to transfer a 1024 bit
  109. ephemeral RSA key for the RSA_EXPORT handshake method. This
  110. message is always fatal.
  111. =item "PV"/"protocol version"
  112. The protocol version the client has attempted to negotiate is
  113. recognized, but not supported. (For example, old protocol
  114. versions might be avoided for security reasons). This message is
  115. always fatal.
  116. =item "IS"/"insufficient security"
  117. Returned instead of handshake_failure when a negotiation has
  118. failed specifically because the server requires ciphers more
  119. secure than those supported by the client. This message is always
  120. fatal.
  121. =item "IE"/"internal error"
  122. An internal error unrelated to the peer or the correctness of the
  123. protocol makes it impossible to continue (such as a memory
  124. allocation failure). This message is always fatal.
  125. =item "US"/"user canceled"
  126. This handshake is being canceled for some reason unrelated to a
  127. protocol failure. If the user cancels an operation after the
  128. handshake is complete, just closing the connection by sending a
  129. close_notify is more appropriate. This alert should be followed
  130. by a close_notify. This message is generally a warning.
  131. =item "NR"/"no renegotiation"
  132. Sent by the client in response to a hello request or by the
  133. server in response to a client hello after initial handshaking.
  134. Either of these would normally lead to renegotiation; when that
  135. is not appropriate, the recipient should respond with this alert;
  136. at that point, the original requester can decide whether to
  137. proceed with the connection. One case where this would be
  138. appropriate would be where a server has spawned a process to
  139. satisfy a request; the process might receive security parameters
  140. (key length, authentication, etc.) at startup and it might be
  141. difficult to communicate changes to these parameters after that
  142. point. This message is always a warning.
  143. =item "UP"/"unknown PSK identity"
  144. Sent by the server to indicate that it does not recognize a PSK
  145. identity or an SRP identity.
  146. =item "UK"/"unknown"
  147. This indicates that no description is available for this alert type.
  148. Probably B<value> does not contain a correct alert message.
  149. =back
  150. =head1 SEE ALSO
  151. L<ssl(7)>, L<SSL_CTX_set_info_callback(3)>
  152. =head1 COPYRIGHT
  153. Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
  154. Licensed under the Apache License 2.0 (the "License"). You may not use
  155. this file except in compliance with the License. You can obtain a copy
  156. in the file LICENSE in the source distribution or at
  157. L<https://www.openssl.org/source/license.html>.
  158. =cut