Make PSK_LEN configurable and adjust PMS size
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index a1428dc..373a1f5 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -3740,12 +3740,7 @@
     if( psk == NULL || psk_identity == NULL )
         return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
 
-    /*
-     * The length will be check later anyway, but in case it is obviously
-     * too large, better abort now. The PMS is as follows:
-     * other_len (2 bytes) + other + psk_len (2 bytes) + psk
-     */
-    if( psk_len + 4 > POLARSSL_PREMASTER_SIZE )
+    if( psk_len > POLARSSL_PSK_MAX_LEN )
         return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
 
     if( ssl->psk != NULL )