Implement FALLBACK_SCSV client-side
diff --git a/library/ssl_cli.c b/library/ssl_cli.c
index 27abb3e..50ab05f 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -596,6 +596,17 @@
*p++ = (unsigned char)( ciphersuites[i] );
}
+ /* Some versions of OpenSSL don't handle it correctly if not at end */
+#if defined(POLARSSL_SSL_FALLBACK_SCSV)
+ if( ssl->fallback == SSL_IS_FALLBACK )
+ {
+ SSL_DEBUG_MSG( 3, ( "adding FALLBACK_SCSV" ) );
+ *p++ = (unsigned char)( SSL_FALLBACK_SCSV >> 8 );
+ *p++ = (unsigned char)( SSL_FALLBACK_SCSV );
+ n++;
+ }
+#endif
+
*q++ = (unsigned char)( n >> 7 );
*q++ = (unsigned char)( n << 1 );