projects
/
oweals
/
openwrt-ustream-ssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
polarssl: disable RC4 support (for security reasons)
[oweals/openwrt-ustream-ssl.git]
/
ustream-polarssl.c
diff --git
a/ustream-polarssl.c
b/ustream-polarssl.c
index cbf24cb44d9b4a504b4d0798963b60270ad7adf2..e1a6da0dcf4baa78c10f57c806ec74c2ccc9cf77 100644
(file)
--- a/
ustream-polarssl.c
+++ b/
ustream-polarssl.c
@@
-20,6
+20,7
@@
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
#include "ustream-ssl.h"
#include "ustream-internal.h"
#include "ustream-ssl.h"
#include "ustream-internal.h"
@@
-232,17
+233,23
@@
__hidden enum ssl_conn_status __ustream_ssl_connect(struct ustream_ssl *us)
__hidden int __ustream_ssl_write(struct ustream_ssl *us, const char *buf, int len)
{
void *ssl = us->ssl;
__hidden int __ustream_ssl_write(struct ustream_ssl *us, const char *buf, int len)
{
void *ssl = us->ssl;
- int
ret = ssl_write(ssl, (const unsigned char *) buf, len)
;
+ int
done = 0, ret = 0
;
- if (ret < 0) {
- if (ssl_do_wait(ret))
- return 0;
+ while (done != len) {
+ ret = ssl_write(ssl, (const unsigned char *) buf + done, len - done);
- ustream_ssl_error(us, ret);
- return -1;
+ if (ret < 0) {
+ if (ssl_do_wait(ret))
+ return done;
+
+ ustream_ssl_error(us, ret);
+ return -1;
+ }
+
+ done += ret;
}
}
- return
ret
;
+ return
done
;
}
__hidden int __ustream_ssl_read(struct ustream_ssl *us, char *buf, int len)
}
__hidden int __ustream_ssl_read(struct ustream_ssl *us, char *buf, int len)
@@
-294,10
+301,6
@@
static const int default_ciphersuites[] =
#endif
#if defined(POLARSSL_DES_C)
TLS_RSA_WITH_3DES_EDE_CBC_SHA,
#endif
#if defined(POLARSSL_DES_C)
TLS_RSA_WITH_3DES_EDE_CBC_SHA,
-#endif
-#if defined(POLARSSL_ARC4_C)
- TLS_RSA_WITH_RC4_128_SHA,
- TLS_RSA_WITH_RC4_128_MD5,
#endif
0
};
#endif
0
};