projects
/
umurmur.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b95d77d
)
Cleanup old support for pre PolarSSL 1.0.0
author
Martin Johansson
<martin@fatbob.nu>
Sat, 4 May 2013 20:44:37 +0000
(22:44 +0200)
committer
Martin Johansson
<martin@fatbob.nu>
Sat, 4 May 2013 20:44:37 +0000
(22:44 +0200)
src/ssl.c
patch
|
blob
|
history
src/ssl.h
patch
|
blob
|
history
diff --git
a/src/ssl.c
b/src/ssl.c
index 9c5236ec6815dff9d70f16890e1d5c973b436b7f..dc7218d0f0459859409c630996459a4ceac668ab 100644
(file)
--- a/
src/ssl.c
+++ b/
src/ssl.c
@@
-257,11
+257,7
@@
SSL_handle_t *SSLi_newconnection(int *fd, bool_t *SSLready)
ssl_set_dbg(ssl, pssl_debug, NULL);
ssl_set_bio(ssl, net_recv, fd, net_send, fd);
ssl_set_dbg(ssl, pssl_debug, NULL);
ssl_set_bio(ssl, net_recv, fd, net_send, fd);
-#ifdef POLARSSL_API_V1
ssl_set_ciphersuites(ssl, ciphers);
ssl_set_ciphersuites(ssl, ciphers);
-#else
- ssl_set_ciphers(ssl, ciphers);
-#endif
#ifdef POLARSSL_API_V1_2
ssl_set_session(ssl, ssn);
#ifdef POLARSSL_API_V1_2
ssl_set_session(ssl, ssn);
@@
-282,11
+278,7
@@
int SSLi_nonblockaccept(SSL_handle_t *ssl, bool_t *SSLready)
rc = ssl_handshake(ssl);
if (rc != 0) {
rc = ssl_handshake(ssl);
if (rc != 0) {
-#ifdef POLARSSL_API_V1
if (rc == POLARSSL_ERR_NET_WANT_READ || rc == POLARSSL_ERR_NET_WANT_WRITE) {
if (rc == POLARSSL_ERR_NET_WANT_READ || rc == POLARSSL_ERR_NET_WANT_WRITE) {
-#else
- if (rc == POLARSSL_ERR_NET_TRY_AGAIN) {
-#endif
return 0;
} else if (POLARSSL_ERR_X509_CERT_VERIFY_FAILED) { /* Allow this (selfsigned etc) */
return 0;
return 0;
} else if (POLARSSL_ERR_X509_CERT_VERIFY_FAILED) { /* Allow this (selfsigned etc) */
return 0;
@@
-304,11
+296,7
@@
int SSLi_read(SSL_handle_t *ssl, uint8_t *buf, int len)
int rc;
rc = ssl_read(ssl, buf, len);
int rc;
rc = ssl_read(ssl, buf, len);
-#ifdef POLARSSL_API_V1
if (rc == POLARSSL_ERR_NET_WANT_READ)
if (rc == POLARSSL_ERR_NET_WANT_READ)
-#else
- if (rc == POLARSSL_ERR_NET_TRY_AGAIN)
-#endif
return SSLI_ERROR_WANT_READ;
return rc;
}
return SSLI_ERROR_WANT_READ;
return rc;
}
@@
-318,11
+306,7
@@
int SSLi_write(SSL_handle_t *ssl, uint8_t *buf, int len)
int rc;
rc = ssl_write(ssl, buf, len);
int rc;
rc = ssl_write(ssl, buf, len);
-#ifdef POLARSSL_API_V1
if (rc == POLARSSL_ERR_NET_WANT_WRITE)
if (rc == POLARSSL_ERR_NET_WANT_WRITE)
-#else
- if (rc == POLARSSL_ERR_NET_TRY_AGAIN)
-#endif
return SSLI_ERROR_WANT_WRITE;
return rc;
}
return SSLI_ERROR_WANT_WRITE;
return rc;
}
diff --git
a/src/ssl.h
b/src/ssl.h
index aa0fe9381754d8fe9c1df157f6f569f5b69d00ba..86cd7bcd5ef5be3ee7d93ca20ed54e913bb6b5b4 100644
(file)
--- a/
src/ssl.h
+++ b/
src/ssl.h
@@
-40,7
+40,10
@@
#include <polarssl/ssl.h>
#include <polarssl/version.h>
#include <polarssl/ssl.h>
#include <polarssl/version.h>
-#define POLARSSL_API_V1
+#if (POLARSSL_VERSION_MAJOR < 1)
+#error PolarSSL version 1.0.0 or later is required!
+#endif
+
#ifdef USE_POLARSSL_HAVEGE
#if (POLARSSL_VERSION_MINOR >= 1)
#define HAVEGE_RAND (havege_random)
#ifdef USE_POLARSSL_HAVEGE
#if (POLARSSL_VERSION_MINOR >= 1)
#define HAVEGE_RAND (havege_random)
@@
-77,11
+80,7
@@
int urandom_bytes(void *ctx, unsigned char *dest, size_t len);
#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
#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
#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
#define SSLI_ERROR_CONNRESET POLARSSL_ERR_NET_CONN_RESET
#define SSLI_ERROR_SYSCALL POLARSSL_ERR_NET_RECV_FAILED