epoc32/include/sslerr.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
williamr@2
    17
williamr@2
    18
#ifndef __SSLERR_H__
williamr@2
    19
#define __SSLERR_H__
williamr@2
    20
williamr@2
    21
/** Base offset for SSL errors. */
williamr@2
    22
#define SSL_ERROR_BASE -7400
williamr@2
    23
/** Base offset for SSL alerts. */
williamr@2
    24
#define SSL_ALERT_BASE 100
williamr@2
    25
williamr@2
    26
/**
williamr@2
    27
 * @file SSLErr.h
williamr@2
    28
 * Error code definitions for TLS.
williamr@2
    29
 */
williamr@2
    30
williamr@2
    31
/**
williamr@2
    32
 * No shared cipher was found.
williamr@2
    33
 * The handshake failed because there was no available shared cipher supported by both the client and the server.
williamr@2
    34
 */
williamr@2
    35
const TInt KErrSSLNoSharedCipher		= SSL_ERROR_BASE - 1;
williamr@2
    36
williamr@2
    37
/**
williamr@2
    38
 * The socket already has received data pending on it.
williamr@2
    39
 * This error is seen when StartClientHandshake is called when
williamr@2
    40
 * there is already data waiting to be read from the socket. */
williamr@2
    41
const TInt KErrSSLSocketBusy			= SSL_ERROR_BASE - 2;
williamr@2
    42
williamr@2
    43
/** One or more cipher suites passed as an argument was invalid. */
williamr@2
    44
const TInt KErrSSLInvalidCipherSuite	= SSL_ERROR_BASE - 3;
williamr@2
    45
williamr@2
    46
/**
williamr@2
    47
 * The certificate that was passed as an argument was invalid. 
williamr@2
    48
 * (this could be that actual certificate is not a valid certificate, or if 
williamr@2
    49
 * certman handles are passed, it wasn't found in certman) */
williamr@2
    50
const TInt KErrSSLInvalidCert			= SSL_ERROR_BASE - 4;
williamr@2
    51
williamr@2
    52
/** No client certificate was supplied. */
williamr@2
    53
const TInt KErrSSLNoClientCert			= SSL_ERROR_BASE - 5;
williamr@2
    54
williamr@2
    55
/** The size of the key is too big. */
williamr@2
    56
const TInt KErrSSLUnsupportedKeySize	= SSL_ERROR_BASE - 6;
williamr@2
    57
williamr@2
    58
/** General unsupported key error */
williamr@2
    59
const TInt KErrSSLUnsupportedKey		= SSL_ERROR_BASE - 7;
williamr@2
    60
williamr@2
    61
/** An invalid record was received. */
williamr@2
    62
const TInt KErrSSLBadRecordHeader		= SSL_ERROR_BASE - 8; 
williamr@2
    63
williamr@2
    64
/////////////////////////////////////////////////////
williamr@2
    65
// Handshake related errors
williamr@2
    66
williamr@2
    67
/** Invalid protocol version. */
williamr@2
    68
const TInt KErrSSLBadProtocolVersion	= SSL_ERROR_BASE - 9;
williamr@2
    69
williamr@2
    70
/** The server only supports the SSL2.0 protocol. */
williamr@2
    71
const TInt KErrSSL2ServerOnly			= SSL_ERROR_BASE - 10;
williamr@2
    72
williamr@2
    73
/** Unexpected message. */
williamr@2
    74
const TInt KErrSSLUnexpectedMessage		= SSL_ERROR_BASE - 11;
williamr@2
    75
williamr@2
    76
/** Unsupported cipher. */
williamr@2
    77
const TInt KErrSSLUnsupportedCipher		= SSL_ERROR_BASE - 12;
williamr@2
    78
williamr@2
    79
/** Bad MAC. */
williamr@2
    80
const TInt KErrSSLBadMAC				= SSL_ERROR_BASE - 13;
williamr@2
    81
williamr@2
    82
/** An SSL alert was received from the remote end, which caused the connection to be terminated. */
williamr@2
    83
const TInt KErrSSLReceivedAlert			= SSL_ERROR_BASE - 14;
williamr@2
    84
williamr@2
    85
williamr@2
    86
/** An invalid handshake message was received. */
williamr@2
    87
const TInt KErrSSLRecvNotSupportedHS	= SSL_ERROR_BASE - 15;
williamr@2
    88
williamr@2
    89
/** A field in the handshake record being parsed was too big. */
williamr@2
    90
const TInt KErrSSLHSRecordFieldTooBig	= SSL_ERROR_BASE - 16;
williamr@2
    91
williamr@2
    92
/** Record header field too big. */
williamr@2
    93
const TInt KErrSSLRecordHeaderTooBig	= SSL_ERROR_BASE - 17;
williamr@2
    94
williamr@2
    95
/** Send data field too big. */
williamr@2
    96
const TInt KErrSSLSendDataTooBig			= SSL_ERROR_BASE - 18;
williamr@2
    97
williamr@2
    98
/** No certificate. */
williamr@2
    99
const TInt KErrSSLNoCertificate			= SSL_ERROR_BASE - 19;
williamr@2
   100
williamr@2
   101
/** Invalid hash. */
williamr@2
   102
const TInt KErrSSLInvalidHash			= SSL_ERROR_BASE - 20;
williamr@2
   103
williamr@2
   104
/** Send cancelled. */
williamr@2
   105
const TInt KErrSSLSendCanceled			= SSL_ERROR_BASE - 21;
williamr@2
   106
williamr@2
   107
/** Receieve cancelled. */
williamr@2
   108
const TInt KErrSSLRecvCanceled			= SSL_ERROR_BASE - 22;
williamr@2
   109
williamr@2
   110
/** CancelHandshake was called during one of the handshake methods. */
williamr@2
   111
const TInt KErrSSLHandshakeCanceled		= SSL_ERROR_BASE - 23;
williamr@2
   112
williamr@2
   113
/** Write failed. */
williamr@2
   114
const TInt KErrSSLWriteFailed			= SSL_ERROR_BASE - 24;
williamr@2
   115
williamr@2
   116
/** The SSL.dll couldn't be loaded by the adaptor. */
williamr@2
   117
const TInt KErrSSLFailedToLoad			= SSL_ERROR_BASE - 25;
williamr@2
   118
williamr@2
   119
/** An unspecified error was signaled from the SSL.dll to the adaptor. */
williamr@2
   120
const TInt KErrSSLDisconnectIndication	= SSL_ERROR_BASE - 26;
williamr@2
   121
williamr@2
   122
/** A leave occured in the SSL.dll. */
williamr@2
   123
const TInt KErrSSLDllLeave				= SSL_ERROR_BASE - 27;
williamr@2
   124
williamr@2
   125
/** A leave occured in the SSL.dll. */
williamr@2
   126
const TInt KErrSSLNullTlsSession				= SSL_ERROR_BASE - 28;
williamr@2
   127
williamr@2
   128
/////////////////////////////////////////////////////
williamr@2
   129
// These error codes are equivalent to the standard TLS protocol Alert message 
williamr@2
   130
// errors as defined in the TLS RFC. They include all those defined in SSL3.0
williamr@2
   131
// The end number of each error is the same as per the RFC, so by using the
williamr@2
   132
// SSL_ERROR_BASE and SSL_ALERT_BASE defines, errors codes can be constructed
williamr@2
   133
// directly from the field within an alert message.
williamr@2
   134
/** Close notification. */
williamr@2
   135
const TInt KErrSSLAlertCloseNotify				= SSL_ERROR_BASE - SSL_ALERT_BASE - 0;
williamr@2
   136
/** An inappropriate message was received. */
williamr@2
   137
const TInt KErrSSLAlertUnexpectedMessage		= SSL_ERROR_BASE - SSL_ALERT_BASE - 10;
williamr@2
   138
/** A record was received with an incorrect MAC. */
williamr@2
   139
const TInt KErrSSLAlertBadRecordMac				= SSL_ERROR_BASE - SSL_ALERT_BASE - 20;
williamr@2
   140
/** A TLS cipher text was decrypted in an invalid way. */
williamr@2
   141
const TInt KErrSSLAlertDecryptionFailed			= SSL_ERROR_BASE - SSL_ALERT_BASE - 21;
williamr@2
   142
/** A TLS cipher text record was received which was too long. */
williamr@2
   143
const TInt KErrSSLAlertRecordOverflow			= SSL_ERROR_BASE - SSL_ALERT_BASE - 22;
williamr@2
   144
/** The decompression function received improper input. */
williamr@2
   145
const TInt KErrSSLAlertDecompressionFailure		= SSL_ERROR_BASE - SSL_ALERT_BASE - 30;
williamr@2
   146
/** With given the options available, the sender was unable to negotiate an acceptable 
williamr@2
   147
* set of security parameters . */
williamr@2
   148
const TInt KErrSSLAlertHandshakeFailure			= SSL_ERROR_BASE - SSL_ALERT_BASE - 40;
williamr@2
   149
/** No certificate. */
williamr@2
   150
const TInt KErrSSLAlertNoCertificate			= SSL_ERROR_BASE - SSL_ALERT_BASE - 41;
williamr@2
   151
/** A certificate was corrupt, e.g. contained signatures that could not be verified. */
williamr@2
   152
const TInt KErrSSLAlertBadCertificate			= SSL_ERROR_BASE - SSL_ALERT_BASE - 42;
williamr@2
   153
/** The certificate was of an unsupported type. */
williamr@2
   154
const TInt KErrSSLAlertUnsupportedCertificate	= SSL_ERROR_BASE - SSL_ALERT_BASE - 43;
williamr@2
   155
/** The certificate was revoked. */
williamr@2
   156
const TInt KErrSSLAlertCertificateRevoked		= SSL_ERROR_BASE - SSL_ALERT_BASE - 44;
williamr@2
   157
/** The certificate was expired. */
williamr@2
   158
const TInt KErrSSLAlertCertificateExpired		= SSL_ERROR_BASE - SSL_ALERT_BASE - 45;
williamr@2
   159
/** An unspecified problem with the certificate. Certificate can not be used. */
williamr@2
   160
const TInt KErrSSLAlertCertificateUnknown		= SSL_ERROR_BASE - SSL_ALERT_BASE - 46;
williamr@2
   161
/** A field in the handshake was out of range or inconsistent with other fields. */
williamr@2
   162
const TInt KErrSSLAlertIllegalParameter			= SSL_ERROR_BASE - SSL_ALERT_BASE - 47;
williamr@2
   163
williamr@2
   164
/** The certificate was not accepted.
williamr@2
   165
* 
williamr@2
   166
* Either the CA certificate could not be located 
williamr@2
   167
* or the CA could not be matched with a known trusted CA. */
williamr@2
   168
const TInt KErrSSLAlertUnknownCA				= SSL_ERROR_BASE - SSL_ALERT_BASE - 48;
williamr@2
   169
/** A valid certificate was received, but the access control denied access. */
williamr@2
   170
const TInt KErrSSLAlertAccessDenied				= SSL_ERROR_BASE - SSL_ALERT_BASE - 49;
williamr@2
   171
/** A message could not be decoded, e.g. some field was out of the specified range. */
williamr@2
   172
const TInt KErrSSLAlertDecodeError				= SSL_ERROR_BASE - SSL_ALERT_BASE - 50;
williamr@2
   173
/** A handshake cryptographic operation failed. */
williamr@2
   174
const TInt KErrSSLAlertDecryptError				= SSL_ERROR_BASE - SSL_ALERT_BASE - 51;
williamr@2
   175
/** A negotiation was not allowed due to export restrictions. */
williamr@2
   176
const TInt KErrSSLAlertExportRestriction		= SSL_ERROR_BASE - SSL_ALERT_BASE - 60;
williamr@2
   177
/** The protocol version was not supported, e.g. the client has attempted to negotiate 
williamr@2
   178
* a recognised, but unsupported protocol. */
williamr@2
   179
const TInt KErrSSLAlertProtocolVersion			= SSL_ERROR_BASE - SSL_ALERT_BASE - 70;
williamr@2
   180
/** Returned instead of KErrSSLAlertHandshakeFailure when the negotiation fails 
williamr@2
   181
* because the server requests ciphers more secure than those supported by the client. */
williamr@2
   182
const TInt KErrSSLAlertInsufficientSecurity		= SSL_ERROR_BASE - SSL_ALERT_BASE - 71;
williamr@2
   183
/** An internal error. */
williamr@2
   184
const TInt KErrSSLAlertInternalError			= SSL_ERROR_BASE - SSL_ALERT_BASE - 80;
williamr@2
   185
/** This handshake is being cancelled by the user. */
williamr@2
   186
const TInt KErrSSLAlertUserCanceled				= SSL_ERROR_BASE - SSL_ALERT_BASE - 90;
williamr@2
   187
/** No renegotiation will be accepted. */
williamr@2
   188
const TInt KErrSSLAlertNoRenegotiation			= SSL_ERROR_BASE - SSL_ALERT_BASE - 100;
williamr@2
   189
williamr@2
   190
williamr@2
   191
#endif // __SSLERR_H__