X-Git-Url: https://www.bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fssl%2Fssl_hs_common.t0;h=dd9abcb53552ea93b9fb85621043ff5645ba702e;hp=f4ad65bf36e2cabdadc77ebf9ded26d4b038ca93;hb=932fb89081a66eef18fee56265fd29b93af0b081;hpb=8e86598b33f9df81d1f77d6cc32568d9ae119d67 diff --git a/src/ssl/ssl_hs_common.t0 b/src/ssl/ssl_hs_common.t0 index f4ad65b..dd9abcb 100644 --- a/src/ssl/ssl_hs_common.t0 +++ b/src/ssl/ssl_hs_common.t0 @@ -879,6 +879,16 @@ hexb| 0000 | \ List terminator. : prf-id ( suite -- id ) cipher-suite-to-elements 15 and ; +\ Test whether a cipher suite is only for TLS-1.2. Cipher suites that +\ can be used with TLS-1.0 or 1.1 use HMAC/SHA-1. RFC do not formally +\ forbid using a CBC-based TLS-1.2 cipher suite, e.g. based on HMAC/SHA-256, +\ with older protocol versions; however, servers should not do that, since +\ it may confuse clients. Since the server code does not try such games, +\ for consistency, the client should reject it as well (normal servers +\ don't do that, so any attempt is a sign of foul play). +: use-tls12? ( suite -- bool ) + cipher-suite-to-elements 0xF0 and 0x20 <> ; + \ Switch to negotiated security parameters for input or output. : switch-encryption ( is-client for-input -- ) { for-input }