X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fssl.h;h=5629c4c6507e468c3738c0abaeb5cbde49408ff6;hb=60aae12f64796bca7e8aed516f2b294120245957;hp=5ed8384e30cdb47c65f8583490624a339fef85f6;hpb=14a67bc74c81651015bbbad075f7eb1c41218cf7;p=umurmur.git diff --git a/src/ssl.h b/src/ssl.h index 5ed8384..5629c4c 100644 --- a/src/ssl.h +++ b/src/ssl.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2009-2010, Martin Johansson - Copyright (C) 2005-2010, Thorvald Natvig +/* Copyright (C) 2009-2011, Martin Johansson + Copyright (C) 2005-2011, Thorvald Natvig All rights reserved. @@ -32,9 +32,25 @@ #ifndef SSL_H_987698 #define SSL_H_987698 +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef USE_POLARSSL #include +#include + +#ifndef POLARSSL_VERSION_MAJOR + #define POLARSSL_API_V0 #else +#if (POLARSSL_VERSION_MAJOR == 0) + #define POLARSSL_API_V0 +#else + #define POLARSSL_API_V1 +#endif +#endif + +#else /* OpenSSL */ #include #include #endif @@ -43,9 +59,14 @@ #include #ifdef USE_POLARSSL -#define SSLI_ERROR_WANT_READ -0x0F300 /* PolarSSL uses -0x0f00 -> --0x0f90 */ +#define SSLI_ERROR_WANT_READ -0x0F300 /* PolarSSL v0.x.x uses -0x0f00 -> --0x0f90, v1.x.x uses -0x7080 -> -0x7e80 */ #define SSLI_ERROR_WANT_WRITE -0x0F310 + +#ifdef POLARSSL_API_V1 +#define SSLI_ERROR_ZERO_RETURN 0 +#else #define SSLI_ERROR_ZERO_RETURN POLARSSL_ERR_NET_CONN_RESET +#endif #define SSLI_ERROR_CONNRESET POLARSSL_ERR_NET_CONN_RESET #define SSLI_ERROR_SYSCALL POLARSSL_ERR_NET_RECV_FAILED