gnutls.h

Go to the documentation of this file.
00001 /* -*- c -*-
00002  * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
00003  *
00004  * Author: Nikos Mavroyanopoulos
00005  *
00006  * This file is part of GNUTLS.
00007  *
00008  * The GNUTLS library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
00021  * USA
00022  *
00023  */
00024 
00025 /* This file contains the types and prototypes for all the
00026  * high level functionality of gnutls main library. For the
00027  * extra functionality (which is under the GNU GPL license) check
00028  * the gnutls/extra.h header. The openssl compatibility layer is
00029  * in gnutls/openssl.h.
00030  *
00031  * The low level cipher functionality is in libgcrypt. Check
00032  * gcrypt.h
00033  */
00034 
00035 #ifndef GNUTLS_H
00036 #define GNUTLS_H
00037 
00038 #ifdef __cplusplus
00039 extern "C"
00040 {
00041 #if 0                           /* keep Emacsens' auto-indent happy */
00042 }
00043 #endif
00044 #endif
00045 
00046 
00052 enum MHD_GNUTLS_KeyExchangeAlgorithm
00053 {
00054   MHD_GNUTLS_KX_UNKNOWN = 0,
00055   MHD_GNUTLS_KX_RSA = 1,
00056 };
00057 
00062 enum MHD_GNUTLS_CredentialsType
00063 {
00067   MHD_GNUTLS_CRD_CERTIFICATE = 1,
00068 
00069 };
00070 
00077 enum MHD_GNUTLS_HashAlgorithm
00078 {
00079   MHD_GNUTLS_MAC_UNKNOWN = 0,
00080   MHD_GNUTLS_MAC_NULL = 1,
00081   MHD_GNUTLS_MAC_MD5,
00082   MHD_GNUTLS_MAC_SHA1,
00083   MHD_GNUTLS_MAC_SHA256
00084 };
00085 
00091 enum MHD_GNUTLS_CompressionMethod
00092 {
00093   MHD_GNUTLS_COMP_UNKNOWN = 0,
00094 
00098   MHD_GNUTLS_COMP_NULL = 1,
00099 
00100 };
00104 enum MHD_GNUTLS_CertificateType
00105 {
00106   MHD_GNUTLS_CRT_UNKNOWN = 0,
00107   MHD_GNUTLS_CRT_X509 = 1
00108 };
00109 
00115 enum MHD_GNUTLS_PublicKeyAlgorithm
00116 {
00117   MHD_GNUTLS_PK_UNKNOWN = 0,
00118   MHD_GNUTLS_PK_RSA = 1,
00119   MHD_GNUTLS_KX_RSA_EXPORT
00120 };
00121 
00122 
00123 
00124 #define LIBGNUTLS_VERSION "2.2.3"
00125 
00126 /* Get size_t. */
00127 #include <stddef.h>
00128 
00129 #define GNUTLS_CIPHER_RIJNDAEL_128_CBC GNUTLS_CIPHER_AES_128_CBC
00130 #define GNUTLS_CIPHER_RIJNDAEL_256_CBC GNUTLS_CIPHER_AES_256_CBC
00131 #define GNUTLS_CIPHER_RIJNDAEL_CBC GNUTLS_CIPHER_AES_128_CBC
00132 #define GNUTLS_CIPHER_ARCFOUR GNUTLS_CIPHER_ARCFOUR_128
00133 
00134 #define GNUTLS_MAX_SESSION_ID 32
00135 #define TLS_MASTER_SIZE 48
00136 #define TLS_RANDOM_SIZE 32
00137 
00138 #include "platform.h"
00139 #include "microhttpd.h"
00140 
00141 typedef enum
00142 {
00143   GNUTLS_PARAMS_RSA_EXPORT = 1,
00144   GNUTLS_PARAMS_DH
00145 } MHD_gnutls_params_type_t;
00146 
00147   /* exported for other gnutls headers. This is the maximum number of
00148    * algorithms (ciphers, kx or macs).
00149    */
00150 #define GNUTLS_MAX_ALGORITHM_NUM 16
00151 #define GNUTLS_COMP_ZLIB GNUTLS_COMP_DEFLATE
00152 
00153 typedef enum
00154 {
00155   GNUTLS_SERVER = 1,
00156   GNUTLS_CLIENT
00157 } MHD_gnutls_connection_end_t;
00158 
00159 typedef enum
00160 {
00161   GNUTLS_AL_WARNING = 1,
00162   GNUTLS_AL_FATAL
00163 } MHD_gnutls_alert_level_t;
00164 
00165 typedef enum
00166 {
00167   GNUTLS_A_CLOSE_NOTIFY,
00168   GNUTLS_A_UNEXPECTED_MESSAGE = 10,
00169   GNUTLS_A_BAD_RECORD_MAC = 20,
00170   GNUTLS_A_DECRYPTION_FAILED,
00171   GNUTLS_A_RECORD_OVERFLOW,
00172   GNUTLS_A_DECOMPRESSION_FAILURE = 30,
00173   GNUTLS_A_HANDSHAKE_FAILURE = 40,
00174   GNUTLS_A_SSL3_NO_CERTIFICATE = 41,
00175   GNUTLS_A_BAD_CERTIFICATE = 42,
00176   GNUTLS_A_UNSUPPORTED_CERTIFICATE,
00177   GNUTLS_A_CERTIFICATE_REVOKED,
00178   GNUTLS_A_CERTIFICATE_EXPIRED,
00179   GNUTLS_A_CERTIFICATE_UNKNOWN,
00180   GNUTLS_A_ILLEGAL_PARAMETER,
00181   GNUTLS_A_UNKNOWN_CA,
00182   GNUTLS_A_ACCESS_DENIED,
00183   GNUTLS_A_DECODE_ERROR = 50,
00184   GNUTLS_A_DECRYPT_ERROR,
00185   GNUTLS_A_EXPORT_RESTRICTION = 60,
00186   GNUTLS_A_PROTOCOL_VERSION = 70,
00187   GNUTLS_A_INSUFFICIENT_SECURITY,
00188   GNUTLS_A_INTERNAL_ERROR = 80,
00189   GNUTLS_A_USER_CANCELED = 90,
00190   GNUTLS_A_NO_RENEGOTIATION = 100,
00191   GNUTLS_A_UNSUPPORTED_EXTENSION = 110,
00192   GNUTLS_A_CERTIFICATE_UNOBTAINABLE = 111,
00193   GNUTLS_A_UNRECOGNIZED_NAME = 112,
00194   GNUTLS_A_UNKNOWN_PSK_IDENTITY = 115,
00195 } MHD_gnutls_alert_description_t;
00196 
00197 typedef enum
00198 { GNUTLS_HANDSHAKE_HELLO_REQUEST = 0,
00199   GNUTLS_HANDSHAKE_CLIENT_HELLO = 1,
00200   GNUTLS_HANDSHAKE_SERVER_HELLO = 2,
00201   GNUTLS_HANDSHAKE_CERTIFICATE_PKT = 11,
00202   GNUTLS_HANDSHAKE_SERVER_KEY_EXCHANGE = 12,
00203   GNUTLS_HANDSHAKE_CERTIFICATE_REQUEST = 13,
00204   GNUTLS_HANDSHAKE_SERVER_HELLO_DONE = 14,
00205   GNUTLS_HANDSHAKE_CERTIFICATE_VERIFY = 15,
00206   GNUTLS_HANDSHAKE_CLIENT_KEY_EXCHANGE = 16,
00207   GNUTLS_HANDSHAKE_FINISHED = 20,
00208   GNUTLS_HANDSHAKE_SUPPLEMENTAL = 23
00209 } MHD_gnutls_handshake_description_t;
00210 
00211 typedef enum
00212 {
00213   GNUTLS_CERT_INVALID = 2,      /* will be set if the certificate
00214                                  * was not verified.
00215                                  */
00216   GNUTLS_CERT_REVOKED = 32,     /* in X.509 this will be set only if CRLs are checked
00217                                  */
00218 
00219   /* Those are extra information about the verification
00220    * process. Will be set only if the certificate was
00221    * not verified.
00222    */
00223   GNUTLS_CERT_SIGNER_NOT_FOUND = 64,
00224   GNUTLS_CERT_SIGNER_NOT_CA = 128,
00225   GNUTLS_CERT_INSECURE_ALGORITHM = 256
00226 } MHD_gnutls_certificate_status_t;
00227 
00228 typedef enum
00229 {
00230   GNUTLS_CERT_IGNORE,
00231   GNUTLS_CERT_REQUEST = 1,
00232   GNUTLS_CERT_REQUIRE
00233 } MHD_gnutls_certificate_request_t;
00234 
00235 typedef enum
00236 {
00237   GNUTLS_SHUT_RDWR = 0,
00238   GNUTLS_SHUT_WR = 1
00239 } MHD_gnutls_close_request_t;
00240 
00241 typedef enum
00242 {
00243   GNUTLS_X509_FMT_DER,
00244   GNUTLS_X509_FMT_PEM
00245 } MHD_gnutls_x509_crt_fmt_t;
00246 
00247 typedef enum
00248 {
00249   GNUTLS_SIGN_UNKNOWN = 0,
00250   GNUTLS_SIGN_RSA_SHA1 = 1,
00251   GNUTLS_SIGN_DSA_SHA1,
00252   GNUTLS_SIGN_RSA_MD5,
00253   GNUTLS_SIGN_RSA_MD2,
00254   GNUTLS_SIGN_RSA_RMD160,
00255   GNUTLS_SIGN_RSA_SHA256,
00256   GNUTLS_SIGN_RSA_SHA384,
00257   GNUTLS_SIGN_RSA_SHA512
00258 } MHD_gnutls_sign_algorithm_t;
00259 
00260 /* If you want to change this, then also change the define in
00261  * MHD_gnutls_int.h, and recompile.
00262  */
00263 typedef void *MHD_gnutls_transport_ptr_t;
00264 
00265 struct MHD_gtls_session_int;
00266 typedef struct MHD_gtls_session_int *MHD_gtls_session_t;
00267 
00268 struct MHD_gtls_dh_params_int;
00269 typedef struct MHD_gtls_dh_params_int *MHD_gtls_dh_params_t;
00270 
00271 struct MHD_gtls_x509_privkey_int;       /* XXX ugly. */
00272 typedef struct MHD_gtls_x509_privkey_int *MHD_gtls_rsa_params_t;        /* XXX ugly. */
00273 
00274 struct MHD_gtls_priority_st;
00275 typedef struct MHD_gtls_priority_st *MHD_gnutls_priority_t;
00276 
00277 typedef struct
00278 {
00279   unsigned char *data;
00280   unsigned int size;
00281 } MHD_gnutls_datum_t;
00282 
00283 
00284 typedef struct MHD_gnutls_params_st
00285 {
00286   MHD_gnutls_params_type_t type;
00287   union params
00288   {
00289     MHD_gtls_dh_params_t dh;
00290     MHD_gtls_rsa_params_t rsa_export;
00291   } params;
00292   int deinit;
00293 } MHD_gnutls_params_st;
00294 
00295 typedef int MHD_gnutls_params_function (MHD_gtls_session_t,
00296                                         MHD_gnutls_params_type_t,
00297                                         MHD_gnutls_params_st *);
00298 
00299 /* internal functions */
00300 int MHD__gnutls_global_init (void);
00301 void MHD__gnutls_global_deinit (void);
00302 
00303 int MHD__gnutls_init (MHD_gtls_session_t * session,
00304                       MHD_gnutls_connection_end_t con_end);
00305 void MHD__gnutls_deinit (MHD_gtls_session_t session);
00306 
00307 int MHD__gnutls_bye (MHD_gtls_session_t session,
00308                      MHD_gnutls_close_request_t how);
00309 int MHD__gnutls_handshake (MHD_gtls_session_t session);
00310 int MHD__gnutls_rehandshake (MHD_gtls_session_t session);
00311 
00312 MHD_gnutls_alert_description_t MHD_gnutls_alert_get (MHD_gtls_session_t
00313                                                      session);
00314 int MHD__gnutls_alert_send (MHD_gtls_session_t session,
00315                             MHD_gnutls_alert_level_t level,
00316                             MHD_gnutls_alert_description_t desc);
00317 int MHD__gnutls_alert_send_appropriate (MHD_gtls_session_t session, int err);
00318 const char *MHD__gnutls_alert_get_name (MHD_gnutls_alert_description_t alert);
00319 
00320 size_t MHD__gnutls_cipher_get_key_size (enum MHD_GNUTLS_CipherAlgorithm
00321                                         algorithm);
00322 
00323   /* error functions */
00324 int MHD_gtls_error_is_fatal (int error);
00325 int MHD_gtls_error_to_alert (int err, int *level);
00326 void MHD_gtls_perror (int error);
00327 const char *MHD_gtls_strerror (int error);
00328 
00329 /*
00330  * Record layer functions.
00331  */
00332 ssize_t MHD__gnutls_record_send (MHD_gtls_session_t session,
00333                                  const void *data, size_t sizeofdata);
00334 ssize_t MHD__gnutls_record_recv (MHD_gtls_session_t session, void *data,
00335                                  size_t sizeofdata);
00336 
00337   /* provides extra compatibility */
00338 int MHD__gnutls_record_get_direction (MHD_gtls_session_t session);
00339 
00340 /*
00341  * TLS Extensions
00342  */
00343 typedef enum
00344 {
00345   GNUTLS_NAME_DNS = 1
00346 } MHD_gnutls_server_name_type_t;
00347 
00348   /* Supplemental data, RFC 4680. */
00349 typedef enum
00350 {
00351   GNUTLS_SUPPLEMENTAL_USER_MAPPING_DATA = 0
00352 } MHD_gnutls_supplemental_data_format_type_t;
00353 
00354 
00355 int MHD_tls_set_default_priority (MHD_gnutls_priority_t *,
00356                                   const char *priority, const char **err_pos);
00357 void MHD__gnutls_priority_deinit (MHD_gnutls_priority_t);
00358 
00359 int MHD__gnutls_priority_set (MHD_gtls_session_t session,
00360                               MHD_gnutls_priority_t);
00361 int MHD__gnutls_priority_set_direct (MHD_gtls_session_t session,
00362                                      const char *priority,
00363                                      const char **err_pos);
00364 
00365 /* get the currently used protocol version */
00366 enum MHD_GNUTLS_Protocol
00367 MHD__gnutls_protocol_get_version (MHD_gtls_session_t session);
00368 
00369 typedef
00370   int (*MHD_gnutls_handshake_post_client_hello_func) (MHD_gtls_session_t);
00371 void MHD__gnutls_handshake_set_max_packet_length (MHD_gtls_session_t
00372                                                   session, size_t max);
00373 
00374 /*
00375  * Functions for setting/clearing credentials
00376  */
00377 void MHD__gnutls_credentials_clear (MHD_gtls_session_t session);
00378 
00379 /*
00380  * cred is a structure defined by the kx algorithm
00381  */
00382 int MHD__gnutls_credentials_set (MHD_gtls_session_t session,
00383                                  enum MHD_GNUTLS_CredentialsType type,
00384                                  void *cred);
00385 
00386 /* Credential structures - used in MHD__gnutls_credentials_set(); */
00387 struct MHD_gtls_certificate_credentials_st;
00388 typedef struct MHD_gtls_certificate_credentials_st
00389   *MHD_gtls_cert_credentials_t;
00390 typedef MHD_gtls_cert_credentials_t MHD_gtls_cert_server_credentials;
00391 typedef MHD_gtls_cert_credentials_t MHD_gtls_cert_client_credentials;
00392 
00393 void MHD__gnutls_certificate_free_credentials (MHD_gtls_cert_credentials_t
00394                                                sc);
00395 int
00396 MHD__gnutls_certificate_allocate_credentials (MHD_gtls_cert_credentials_t
00397                                               * res);
00398 
00399 void MHD__gnutls_certificate_free_keys (MHD_gtls_cert_credentials_t sc);
00400 void MHD__gnutls_certificate_free_cas (MHD_gtls_cert_credentials_t sc);
00401 void MHD__gnutls_certificate_free_ca_names (MHD_gtls_cert_credentials_t sc);
00402 
00403 int MHD__gnutls_certificate_set_x509_key_mem (MHD_gtls_cert_credentials_t
00404                                               res,
00405                                               const MHD_gnutls_datum_t *
00406                                               CERT,
00407                                               const MHD_gnutls_datum_t *
00408                                               KEY,
00409                                               MHD_gnutls_x509_crt_fmt_t type);
00410 
00411 void MHD__gnutls_certificate_send_x509_rdn_sequence (MHD_gtls_session_t
00412                                                      session, int status);
00413 
00414 /*
00415  * New functions to allow setting already parsed X.509 stuff.
00416  */
00417 struct MHD_gtls_x509_privkey_int;
00418 typedef struct MHD_gtls_x509_privkey_int *MHD_gnutls_x509_privkey_t;
00419 
00420 struct MHD_gnutls_x509_crl_int;
00421 typedef struct MHD_gnutls_x509_crl_int *MHD_gnutls_x509_crl_t;
00422 
00423 struct MHD_gnutls_x509_crt_int;
00424 typedef struct MHD_gnutls_x509_crt_int *MHD_gnutls_x509_crt_t;
00425 
00426 /* global state functions
00427  */
00428 
00429 
00430 typedef void *(*MHD_gnutls_alloc_function) (size_t);
00431 typedef int (*MHD_gnutls_is_secure_function) (const void *);
00432 typedef void *(*MHD_gnutls_calloc_function) (size_t, size_t);
00433 typedef void (*MHD_gnutls_free_function) (void *);
00434 typedef void *(*MHD_gnutls_realloc_function) (void *, size_t);
00435 
00436 /* For use in callbacks */
00437 extern MHD_gnutls_alloc_function MHD_gnutls_malloc;
00438 extern MHD_gnutls_alloc_function MHD_gnutls_secure_malloc;
00439 extern MHD_gnutls_realloc_function MHD_gnutls_realloc;
00440 extern MHD_gnutls_calloc_function MHD_gnutls_calloc;
00441 extern MHD_gnutls_free_function MHD_gnutls_free;
00442 
00443 typedef void (*MHD_gnutls_log_func) (int, const char *);
00444 void MHD_gtls_global_set_log_function (MHD_gnutls_log_func log_func);
00445 void MHD_gtls_global_set_log_level (int level);
00446 
00447 /*
00448  * Diffie Hellman parameter handling.
00449  */
00450 int MHD__gnutls_dh_params_init (MHD_gtls_dh_params_t * dh_params);
00451 void MHD__gnutls_dh_params_deinit (MHD_gtls_dh_params_t dh_params);
00452 
00453 
00454 /* RSA params */
00455 int MHD__gnutls_rsa_params_init (MHD_gtls_rsa_params_t * rsa_params);
00456 void MHD__gnutls_rsa_params_deinit (MHD_gtls_rsa_params_t rsa_params);
00457 int MHD__gnutls_rsa_params_generate2 (MHD_gtls_rsa_params_t params,
00458                                       unsigned int bits);
00459 
00460 
00461 /*
00462  * Session stuff
00463  */
00464 typedef ssize_t (*MHD_gtls_pull_func) (MHD_gnutls_transport_ptr_t, void *,
00465                                        size_t);
00466 typedef ssize_t (*MHD_gtls_push_func) (MHD_gnutls_transport_ptr_t,
00467                                        const void *, size_t);
00468 void MHD__gnutls_transport_set_ptr (MHD_gtls_session_t session,
00469                                     MHD_gnutls_transport_ptr_t ptr);
00470 void MHD__gnutls_transport_set_lowat (MHD_gtls_session_t session, int num);
00471 
00472 
00473 void MHD__gnutls_transport_set_push_function (MHD_gtls_session_t session,
00474                                               MHD_gtls_push_func push_func);
00475 void MHD__gnutls_transport_set_pull_function (MHD_gtls_session_t session,
00476                                               MHD_gtls_pull_func pull_func);
00477 
00478 typedef enum MHD_gnutls_x509_subject_alt_name_t
00479 {
00480   GNUTLS_SAN_DNSNAME = 1,
00481   GNUTLS_SAN_RFC822NAME,
00482   GNUTLS_SAN_URI,
00483   GNUTLS_SAN_IPADDRESS,
00484   GNUTLS_SAN_OTHERNAME,
00485   GNUTLS_SAN_DN,
00486   /* The following are "virtual" subject alternative name types, in
00487      that they are represented by an otherName value and an OID.
00488      Used by MHD_gnutls_x509_crt_get_subject_alt_othername_oid().  */
00489   GNUTLS_SAN_OTHERNAME_XMPP = 1000
00490 } MHD_gnutls_x509_subject_alt_name_t;
00491 
00492 typedef struct MHD_gnutls_retr_st
00493 {
00494   enum MHD_GNUTLS_CertificateType type;
00495   union cert
00496   {
00497     MHD_gnutls_x509_crt_t *x509;
00498   } cert;
00499   unsigned int ncerts;
00500 
00501   union key
00502   {
00503     MHD_gnutls_x509_privkey_t x509;
00504   } key;
00505 
00506   unsigned int deinit_all;      /* if non zero all keys will be deinited */
00507 } MHD_gnutls_retr_st;
00508 
00509 typedef int
00510 MHD_gnutls_certificate_client_retrieve_function (MHD_gtls_session_t,
00511                                                  const MHD_gnutls_datum_t
00512                                                  * req_ca_rdn, int nreqs,
00513                                                  const enum
00514                                                  MHD_GNUTLS_PublicKeyAlgorithm
00515                                                  *pk_algos,
00516                                                  int pk_algos_length,
00517                                                  MHD_gnutls_retr_st *);
00518 
00519 typedef int
00520 MHD_gnutls_certificate_server_retrieve_function (MHD_gtls_session_t,
00521                                                  MHD_gnutls_retr_st *);
00522 
00523   /*
00524    * Functions that allow auth_info_t structures handling
00525    */
00526 enum MHD_GNUTLS_CredentialsType MHD_gtls_auth_get_type (MHD_gtls_session_t
00527                                                         session);
00528   /*
00529    * DH
00530    */
00531 void MHD__gnutls_dh_set_prime_bits (MHD_gtls_session_t session,
00532                                     unsigned int bits);
00533 
00534   /* External signing callback.  Experimental. */
00535 typedef int (*MHD_gnutls_sign_func) (MHD_gtls_session_t session,
00536                                      void *userdata,
00537                                      enum MHD_GNUTLS_CertificateType
00538                                      cert_type,
00539                                      const MHD_gnutls_datum_t * cert,
00540                                      const MHD_gnutls_datum_t * hash,
00541                                      MHD_gnutls_datum_t * signature);
00542 
00543   /* key_usage will be an OR of the following values: */
00544   /* when the key is to be used for signing: */
00545 #define GNUTLS_KEY_DIGITAL_SIGNATURE    128
00546 #define GNUTLS_KEY_NON_REPUDIATION      64
00547   /* when the key is to be used for encryption: */
00548 #define GNUTLS_KEY_KEY_ENCIPHERMENT     32
00549 #define GNUTLS_KEY_DATA_ENCIPHERMENT    16
00550 #define GNUTLS_KEY_KEY_AGREEMENT        8
00551 #define GNUTLS_KEY_KEY_CERT_SIGN        4
00552 #define GNUTLS_KEY_CRL_SIGN             2
00553 #define GNUTLS_KEY_ENCIPHER_ONLY        1
00554 #define GNUTLS_KEY_DECIPHER_ONLY        32768
00555 
00556   /*
00557    * Error codes. TLS alert mapping shown in comments.
00558    */
00559 #define GNUTLS_E_SUCCESS 0
00560 #define GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM -3
00561 #define GNUTLS_E_UNKNOWN_CIPHER_TYPE -6
00562 #define GNUTLS_E_LARGE_PACKET -7
00563 #define GNUTLS_E_UNSUPPORTED_VERSION_PACKET -8  /* GNUTLS_A_PROTOCOL_VERSION */
00564 #define GNUTLS_E_UNEXPECTED_PACKET_LENGTH -9    /* GNUTLS_A_RECORD_OVERFLOW */
00565 #define GNUTLS_E_INVALID_SESSION -10
00566 #define GNUTLS_E_FATAL_ALERT_RECEIVED -12
00567 #define GNUTLS_E_UNEXPECTED_PACKET -15  /* GNUTLS_A_UNEXPECTED_MESSAGE */
00568 #define GNUTLS_E_WARNING_ALERT_RECEIVED -16
00569 #define GNUTLS_E_ERROR_IN_FINISHED_PACKET -18
00570 #define GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET -19
00571 #define GNUTLS_E_UNKNOWN_CIPHER_SUITE -21       /* GNUTLS_A_HANDSHAKE_FAILURE */
00572 #define GNUTLS_E_UNWANTED_ALGORITHM -22
00573 #define GNUTLS_E_MPI_SCAN_FAILED -23
00574 #define GNUTLS_E_DECRYPTION_FAILED -24  /* GNUTLS_A_DECRYPTION_FAILED, GNUTLS_A_BAD_RECORD_MAC */
00575 #define GNUTLS_E_MEMORY_ERROR -25
00576 #define GNUTLS_E_DECOMPRESSION_FAILED -26       /* GNUTLS_A_DECOMPRESSION_FAILURE */
00577 #define GNUTLS_E_COMPRESSION_FAILED -27
00578 #define GNUTLS_E_AGAIN -28
00579 #define GNUTLS_E_EXPIRED -29
00580 #define GNUTLS_E_DB_ERROR -30
00581 #define GNUTLS_E_SRP_PWD_ERROR -31
00582 #define GNUTLS_E_INSUFFICIENT_CREDENTIALS -32
00583 #define GNUTLS_E_INSUFICIENT_CREDENTIALS GNUTLS_E_INSUFFICIENT_CREDENTIALS      /* for backwards compatibility only */
00584 #define GNUTLS_E_INSUFFICIENT_CRED GNUTLS_E_INSUFFICIENT_CREDENTIALS
00585 #define GNUTLS_E_INSUFICIENT_CRED GNUTLS_E_INSUFFICIENT_CREDENTIALS     /* for backwards compatibility only */
00586 
00587 #define GNUTLS_E_HASH_FAILED -33
00588 #define GNUTLS_E_BASE64_DECODING_ERROR -34
00589 
00590 #define GNUTLS_E_MPI_PRINT_FAILED -35
00591 #define GNUTLS_E_REHANDSHAKE -37        /* GNUTLS_A_NO_RENEGOTIATION */
00592 #define GNUTLS_E_GOT_APPLICATION_DATA -38
00593 #define GNUTLS_E_RECORD_LIMIT_REACHED -39
00594 #define GNUTLS_E_ENCRYPTION_FAILED -40
00595 
00596 #define GNUTLS_E_PK_ENCRYPTION_FAILED -44
00597 #define GNUTLS_E_PK_DECRYPTION_FAILED -45
00598 #define GNUTLS_E_PK_SIGN_FAILED -46
00599 #define GNUTLS_E_X509_UNSUPPORTED_CRITICAL_EXTENSION -47
00600 #define GNUTLS_E_KEY_USAGE_VIOLATION -48
00601 #define GNUTLS_E_NO_CERTIFICATE_FOUND -49       /* GNUTLS_A_BAD_CERTIFICATE */
00602 #define GNUTLS_E_INVALID_REQUEST -50
00603 #define GNUTLS_E_SHORT_MEMORY_BUFFER -51
00604 #define GNUTLS_E_INTERRUPTED -52
00605 #define GNUTLS_E_PUSH_ERROR -53
00606 #define GNUTLS_E_PULL_ERROR -54
00607 #define GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER -55 /* GNUTLS_A_ILLEGAL_PARAMETER */
00608 #define GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE -56
00609 #define GNUTLS_E_PKCS1_WRONG_PAD -57
00610 #define GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION -58
00611 #define GNUTLS_E_INTERNAL_ERROR -59
00612 #define GNUTLS_E_DH_PRIME_UNACCEPTABLE -63
00613 #define GNUTLS_E_FILE_ERROR -64
00614 #define GNUTLS_E_TOO_MANY_EMPTY_PACKETS -78
00615 #define GNUTLS_E_UNKNOWN_PK_ALGORITHM -80
00616 
00617 
00618   /* returned if libextra functionality was requested but
00619    * MHD_gnutls_global_init_extra() was not called.
00620    */
00621 #define GNUTLS_E_INIT_LIBEXTRA -82
00622 #define GNUTLS_E_LIBRARY_VERSION_MISMATCH -83
00623 
00624 
00625   /* returned if you need to generate temporary RSA
00626    * parameters. These are needed for export cipher suites.
00627    */
00628 #define GNUTLS_E_NO_TEMPORARY_RSA_PARAMS -84
00629 
00630 #define GNUTLS_E_LZO_INIT_FAILED -85
00631 #define GNUTLS_E_NO_COMPRESSION_ALGORITHMS -86
00632 #define GNUTLS_E_NO_CIPHER_SUITES -87
00633 
00634 #define GNUTLS_E_PK_SIG_VERIFY_FAILED -89
00635 
00636 #define GNUTLS_E_ILLEGAL_SRP_USERNAME -90
00637 #define GNUTLS_E_SRP_PWD_PARSING_ERROR -91
00638 #define GNUTLS_E_NO_TEMPORARY_DH_PARAMS -93
00639 
00640   /* For certificate and key stuff
00641    */
00642 #define GNUTLS_E_ASN1_ELEMENT_NOT_FOUND -67
00643 #define GNUTLS_E_ASN1_IDENTIFIER_NOT_FOUND -68
00644 #define GNUTLS_E_ASN1_DER_ERROR -69
00645 #define GNUTLS_E_ASN1_VALUE_NOT_FOUND -70
00646 #define GNUTLS_E_ASN1_GENERIC_ERROR -71
00647 #define GNUTLS_E_ASN1_VALUE_NOT_VALID -72
00648 #define GNUTLS_E_ASN1_TAG_ERROR -73
00649 #define GNUTLS_E_ASN1_TAG_IMPLICIT -74
00650 #define GNUTLS_E_ASN1_TYPE_ANY_ERROR -75
00651 #define GNUTLS_E_ASN1_SYNTAX_ERROR -76
00652 #define GNUTLS_E_ASN1_DER_OVERFLOW -77
00653 #define GNUTLS_E_CERTIFICATE_ERROR -43
00654 #define GNUTLS_E_X509_CERTIFICATE_ERROR GNUTLS_E_CERTIFICATE_ERROR
00655 #define GNUTLS_E_CERTIFICATE_KEY_MISMATCH -60
00656 #define GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE -61       /* GNUTLS_A_UNSUPPORTED_CERTIFICATE */
00657 #define GNUTLS_E_X509_UNKNOWN_SAN -62
00658 #define GNUTLS_E_X509_UNSUPPORTED_ATTRIBUTE -95
00659 #define GNUTLS_E_UNKNOWN_HASH_ALGORITHM -96
00660 #define GNUTLS_E_UNKNOWN_PKCS_CONTENT_TYPE -97
00661 #define GNUTLS_E_UNKNOWN_PKCS_BAG_TYPE -98
00662 #define GNUTLS_E_INVALID_PASSWORD -99
00663 #define GNUTLS_E_MAC_VERIFY_FAILED -100 /* for PKCS #12 MAC */
00664 #define GNUTLS_E_CONSTRAINT_ERROR -101
00665 
00666 #define GNUTLS_E_WARNING_IA_IPHF_RECEIVED -102
00667 #define GNUTLS_E_WARNING_IA_FPHF_RECEIVED -103
00668 
00669 #define GNUTLS_E_IA_VERIFY_FAILED -104
00670 
00671 #define GNUTLS_E_UNKNOWN_ALGORITHM -105
00672 
00673 #define GNUTLS_E_BASE64_ENCODING_ERROR -201
00674 #define GNUTLS_E_INCOMPATIBLE_GCRYPT_LIBRARY -202       /* obsolete */
00675 #define GNUTLS_E_INCOMPATIBLE_CRYPTO_LIBRARY -202
00676 #define GNUTLS_E_INCOMPATIBLE_LIBTASN1_LIBRARY -203
00677 
00678 #define GNUTLS_E_X509_UNSUPPORTED_OID -205
00679 
00680 #define GNUTLS_E_RANDOM_FAILED -206
00681 #define GNUTLS_E_BASE64_UNEXPECTED_HEADER_ERROR -207
00682 
00683 
00684 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -1250
00685 
00686 #define GNUTLS_E_APPLICATION_ERROR_MAX -65000
00687 #define GNUTLS_E_APPLICATION_ERROR_MIN -65500
00688 
00689 
00690 #if 0                           /* keep Emacsens' auto-indent happy */
00691 {
00692 #endif
00693 #ifdef __cplusplus
00694 }
00695 #endif
00696 
00697 #endif /* GNUTLS_H */

Generated on Fri Feb 27 18:18:39 2009 for GNU libmicrohttpd by  doxygen 1.5.8