the anatomy of transport layer securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · the...

27
The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute The MITRE Corporation March 2013 Bertinoro International Spring School Thanks to the US National Science Foundation, under grant 1116557 [email protected]

Upload: others

Post on 07-Oct-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Anatomy of TransportLayer Security

Joshua D. GuttmanWorcester Polytechnic Institute

The MITRE Corporation

March 2013Bertinoro International Spring School

Thanks to the US National Science Foundation, under grant 1116557

[email protected]

Page 2: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

Transport-Layer Security

Provide secure sessions between a client C and a server S

Two main layers:I Record layer transports a sequence of pieces of dataI Handshake layer agrees on keys to use in record layer

Most communication happens in record layer

Most of the interest is in the handshake protocol

JG Shapes Mar 2013 2 / 13

Page 3: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Record Layer

Breaks stream of data into records

For the i th record t, uses a key mkfor a Message Authentication Code

HMAC(mk , (i , t))

Integrity guarantee on contents tand position in stream i

Encrypts this and t using an ek

{| t, HMAC(mk , (i , t)) |}ek

This provides confidentiality for whole unit

Requires 2 keys, mk and ekactually, two keys in each direction C → S and S → C

JG Shapes Mar 2013 3 / 13

Page 4: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Record Layer

Breaks stream of data into records

For the i th record t, uses a key mkfor a Message Authentication Code

HMAC(mk , (i , t))

Integrity guarantee on contents tand position in stream i

Encrypts this and t using an ek

{| t, HMAC(mk , (i , t)) |}ek

This provides confidentiality for whole unit

Requires 2 keys, mk and ekactually, two keys in each direction C → S and S → C

JG Shapes Mar 2013 3 / 13

Page 5: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Record Layer

Breaks stream of data into records

For the i th record t, uses a key mkfor a Message Authentication Code

HMAC(mk , (i , t))

Integrity guarantee on contents tand position in stream i

Encrypts this and t using an ek

{| t, HMAC(mk , (i , t)) |}ek

This provides confidentiality for whole unit

Requires 2 keys, mk and ekactually, two keys in each direction C → S and S → C

JG Shapes Mar 2013 3 / 13

Page 6: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Record Layer

Breaks stream of data into records

For the i th record t, uses a key mkfor a Message Authentication Code

HMAC(mk , (i , t))

Integrity guarantee on contents tand position in stream i

Encrypts this and t using an ek

{| t, HMAC(mk , (i , t)) |}ek

This provides confidentiality for whole unit

Requires 2 keys, mk and ekactually, two keys in each direction C → S and S → C

JG Shapes Mar 2013 3 / 13

Page 7: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Record Layer

Breaks stream of data into records

For the i th record t, uses a key mkfor a Message Authentication Code

HMAC(mk , (i , t))

Integrity guarantee on contents tand position in stream i

Encrypts this and t using an ek

{| t, HMAC(mk , (i , t)) |}ek

This provides confidentiality for whole unit

Requires 2 keys, mk and ekactually, two keys in each direction C → S and S → C

JG Shapes Mar 2013 3 / 13

Page 8: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

Record Layer Security Goals

Confidentiality Adversary should learn nothing of contentsof stream C → S or S → C

Session Independence No principal P 6= C ,S should learn anything ofcontents of stream C → S or S → C

Integrity The stream of data records received 〈ri 〉i<`

should be an initial subsequence of those sent 〈sj〉j<`′

` ≤ `′ and rk = sk for all k < `

Main inferred goals for Handshake layer:

Provide undisclosed keys mk , ck in each directionMust be distinct in all sessions

JG Shapes Mar 2013 4 / 13

Page 9: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

Record Layer Security Goals

Confidentiality Adversary should learn nothing of contentsof stream C → S or S → C

Session Independence No principal P 6= C ,S should learn anything ofcontents of stream C → S or S → C

Integrity The stream of data records received 〈ri 〉i<`

should be an initial subsequence of those sent 〈sj〉j<`′

` ≤ `′ and rk = sk for all k < `

Main inferred goals for Handshake layer:

Provide undisclosed keys mk , ck in each directionMust be distinct in all sessions

JG Shapes Mar 2013 4 / 13

Page 10: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

Record Layer Security Goals

Confidentiality Adversary should learn nothing of contentsof stream C → S or S → C

Session Independence No principal P 6= C ,S should learn anything ofcontents of stream C → S or S → C

Integrity The stream of data records received 〈ri 〉i<`

should be an initial subsequence of those sent 〈sj〉j<`′

` ≤ `′ and rk = sk for all k < `

Main inferred goals for Handshake layer:

Provide undisclosed keys mk , ck in each directionMust be distinct in all sessions

JG Shapes Mar 2013 4 / 13

Page 11: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

Record Layer Security Goals

Confidentiality Adversary should learn nothing of contentsof stream C → S or S → C

Session Independence No principal P 6= C ,S should learn anything ofcontents of stream C → S or S → C

Integrity The stream of data records received 〈ri 〉i<`

should be an initial subsequence of those sent 〈sj〉j<`′

` ≤ `′ and rk = sk for all k < `

Main inferred goals for Handshake layer:

Provide undisclosed keys mk , ck in each directionMust be distinct in all sessions

JG Shapes Mar 2013 4 / 13

Page 12: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Handshake ProtocolMain Ideas (bilateral mode)

C chooses the session secret pmsthe pre-master secret

Confidentiality: encrypt pms with S ’s public encryption key

S ’s authentication of C : C signs a msg

Keys pubk(S), pubk(C ) are certified by a Certificate Authority

Session property: Server creates a nonce rsI Client also creates a nonce rcI Allows pms reuse in some cases

nonces contribute to keys

JG Shapes Mar 2013 5 / 13

Page 13: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Handshake

C → S : rc plus supplement

S → C : rs plus supplement

S → C : [[ cert S , pubk(S) ]]CA uses sk(S)

C → S : [[ cert C , pubk(C ) ]]CA

C → S : {| cl ver pms |}pubk(S)C → S : [[ Hash(previous msgs) ]]sk(C)

JG Shapes Mar 2013 6 / 13

Page 14: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Core ProtocolTLS subprotocol 0

C → S : {| cl ver pms |}pubk(S)

Ensures to C that pms undisclosedassuming sk(S) uncompromised

JG Shapes Mar 2013 7 / 13

Page 15: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Core ProtocolTLS subprotocol 0

C → S : {| cl ver pms |}pubk(S)

Ensures to C that pms undisclosedassuming sk(S) uncompromised

JG Shapes Mar 2013 7 / 13

Page 16: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

TLS subprotocol 1

S → C : [[ cert S , pubk(S) ]]CA

C → S : {| cl ver pms |}pubk(S)

JG Shapes Mar 2013 8 / 13

Page 17: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

TLS subprotocol 1

CA→ C : [[ cert S , pubk(S) ]]CA

C → S : {| cl ver pms |}pubk(S)

JG Shapes Mar 2013 8 / 13

Page 18: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

TLS subprotocol 2

CA→ C : [[ cert S , pubk(S) ]]CA

CA→ S : [[ cert C , pubk(C ) ]]CA

C → S : {| cl ver pms |}pubk(S)C → S : [[ Hash(previous msgs) ]]sk(C)

JG Shapes Mar 2013 9 / 13

Page 19: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

TLS subprotocol 3

CA→ C : [[ cert S , pubk(S) ]]CA

CA→ S : [[ cert C , pubk(C ) ]]CA

C → S : {| cl ver pms |}pubk(S)C → S : [[ Hash(previous msgs) ]]sk(C)

JG Shapes Mar 2013 10 / 13

Page 20: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

TLS subprotocol 3

CA→ C : [[ cert S , pubk(S) ]]CA

CA→ S : [[ cert C , pubk(C ) ]]CA

C → S : {| cl ver pms |}pubk(S)C → S : [[ Hash(previous msgs) ]]sk(C)

Same as subprotocol 2

JG Shapes Mar 2013 10 / 13

Page 21: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

TLS subprotocol 3

CA→ C : [[ cert S , pubk(S) ]]CA

CA→ S : [[ cert C , pubk(C ) ]]CA

C → S : {| cl ver pms |}pubk(S)C → S : [[ Hash(previous msgs) ]]sk(C)

(defrole certificate auth

(vars (subject name ca name))

(trace

(send (cert subject name (pubk subject name) (privk ca))))

(non-orig (privk subject name)))

JG Shapes Mar 2013 10 / 13

Page 22: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The Handshake

C → S : rc plus supplement

S → C : rs plus supplement

S → C : [[ cert S , pubk(S) ]]CA uses sk(S)

C → S : [[ cert C , pubk(C ) ]]CA

C → S : {| cl ver pms |}pubk(S)C → S : [[ Hash(previous msgs) ]]sk(C)

JG Shapes Mar 2013 11 / 13

Page 23: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The TLS Key Derivations

ms = Hash(pms, PreMasterSec , rc , rs)

cm = Hash(ClientMAC ms)

ce = Hash(ClientEnc ms)

sm = Hash(ServerMAC ms)

se = Hash(ServerEnc ms)

JG Shapes Mar 2013 12 / 13

Page 24: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The TLS Key Derivations

ms = Hash(pms, PreMasterSec , rc , rs)

cm = Hash(ClientMAC ms)

ce = Hash(ClientEnc ms)

sm = Hash(ServerMAC ms)

se = Hash(ServerEnc ms)

JG Shapes Mar 2013 12 / 13

Page 25: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The TLS Key Derivations

ms = Hash(pms, PreMasterSec , rc , rs)

cm = Hash(ClientMAC ms)

ce = Hash(ClientEnc ms)

sm = Hash(ServerMAC ms)

se = Hash(ServerEnc ms)

JG Shapes Mar 2013 12 / 13

Page 26: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

The TLS Key Derivations

ms = Hash(pms, PreMasterSec , rc , rs)

cm = Hash(ClientMAC ms)

ce = Hash(ClientEnc ms)

sm = Hash(ServerMAC ms)

se = Hash(ServerEnc ms)

JG Shapes Mar 2013 12 / 13

Page 27: The Anatomy of Transport Layer Securityweb.cs.wpi.edu/~guttman/biss/tls_anatomized.pdf · The Anatomy of Transport Layer Security Joshua D. Guttman Worcester Polytechnic Institute

Record Layer Security Goals

Confidentiality Adversary should learn nothing of contentsof stream C → S or S → C

Session Independence No principal P 6= C ,S should learn anything ofcontents of stream C → S or S → C

Integrity The stream of data records received 〈ri 〉i<`

should be an initial subsequence of those sent 〈sj〉j<`′

` ≤ `′ and rk = sk for all k < `

Main inferred goals for Handshake layer:

Provide undisclosed keys mk , ck in each directionMust be distinct in all sessions

JG Shapes Mar 2013 13 / 13