Upper-Layer Authentication
This chapter reviews several of the major authentication
methods. We cover in some detail the way that Transport Layer Security and
Kerberos V5 work and how they can be applied to Wi-Fi network security. We also
look at some newer ideas, such as ways to link together Wi-Fi LAN user
authentication with cellular phone authentication.
Introduction
Chapter 7
defines three major layers of security: wireless LAN layer, the access control
layer, and the authentication layer. This chapter looks at the authentication
layer and, more specifically, at the protocols used to implement authentication.
IEEE 802.11 lies in the wireless LAN layer, which is considered the lowest
layer, and IEEE 802.1X lies in the access control layer. The authentication
methods use higher-layer protocols and the term "upper-layer authentication"
reflects the fact that the methods do not depend on specific LAN technology. A
range of different methods can be used for authentication in RSN; some of the
major ones are described here.
We look first at Transport Layer Security (TLS), the default
method for WPA that can also be used with RSN. Later in the chapter we look at
Kerberos V5 and some of the new methods being invented, such as Protected EAP
(PEAP) and the use of cellular phone authentication for Wi-Fi LAN devices
(GSM-SIM). We also examine the inner workings of the authentication process and
see how the messages are mostly exchanged between the supplicant and the server,
with the access point (authenticator) playing a sort of observant go between in
the process.
Who Decides Which Authentication Method to Use?
Given the number of authentication methods that could be used
with RSN, the question arises, which one is correct? There is no simple answer.
If you are starting from scratch to implement security, you should choose the
method that is most widely supported in the available products. Today a leading
candidate is TLS. However, if you have an existing system such as Kerberos V5 in
operation, perhaps used with your wired network, it makes sense to try to apply
that existing system to RSN. RSN is intended to provide this flexibility. In the
interests of interoperability, the Wi-Fi Alliance has mandated that all WPA
products should, at least, support TLS.
The Wi-Fi Alliance was free to choose which upper-layer
authentication methods should be supported. However, the IEEE 802 working group
is more restricted in specifying such things because, by virtue of being
"upper-layer," the authentication method falls outside the scope of LAN protocol
standards.
As such, IEEE 802.11 cannot and does not define the upper-layer
authentication method, and instead leaves it to the implementers of the systems
to decide. This was an issue of much rancor during the early days of the IEEE
802.11i standards work. Some people pointed out that it would be very hard to
guarantee interoperability between different vendors' systems unless all the
details of the authentication methods were specified. However, other people
pointed out that, because of the range of different applications for Wi-Fi LAN,
a single authentication method could not be suitable in all cases. This problem
has been reduced by WPA, which does specify the method (TLS). It seems very
likely that the method that is deployed for WPA will also be the most popular
one when the transition to IEEE 802.11i RSN occurs.
This chapter presents solutions for several choices, including
TLS, Kerberos V5, Protected EAP (PEAP), and the use of cellular phone
authentication for wireless LAN devices (GSM-SIM). While the use of TLS is well
defined through WPA, different vendors may implement other methods differently
and interoperability cannot always be guaranteed. For example, the RFCs for
Kerberos as defined by the IETF do not specify how to implement over IEEE
802.1X, let alone RSN. If you are not using WPA with TLS, you need to check
carefully whether a vendor supports the authentication method you want, and
whether they do so in the same way as any other vendor whose products you have
purchased.
Use of Keys in Upper-Layer Authentication
Authentication is part of a process of creating a security
context within which communications can take place. Because the process of full
authentication is costly and time consuming, it is common to do full
authentication occasionally and provide some token that can be used as proof of
authentication in subsequent transactions. In the case of RSN, and indeed most
security protocols, the proof is provided by creating secret key values as part
of the authentication process.
The upper-layer authentication method is responsible for
proving beyond a doubt that each party possesses some secret knowledge connected
to their identity, and for providing the tokens or keys needed to support a
security context. It has to do this in a way that does not leak any useful
information about the shared secrets.
Before looking in detail at individual methods, let's look at
the two main classes of solution: symmetric keys and asymmetric keys, sometimes
known as secret and public keys, respectively.
Symmetric Keys
The concept of the symmetric secret key is simple. Each party
has a copy of some secret information. Authentication occurs when each party
proves to the other that they know the secret. This is like the child's method,
"You can't come in unless you tell me the password." When each party has proved
itself, they can both create matching session keys for use in the security
context. Such keys are derived from the secret master key but may also
incorporate other information, such as the time and arbitrary numbers created
for the session (called nonces). The purpose of these extra items is to ensure
that the session keys are usable only in the current session and cannot be
reused later.
The main limitation with the secret key approach is that you
have to get the secret to both parties in the first place. Sometimes that is not
a problem. To communicate with your domestic partner, for example, you could
agree on your secret Wi-Fi LAN key during a private moment when no one else is
listening. This scenario, or at least the key exchange part, also works in
corporate environments in which there is a secure place for the two parties,
such as the employee and the IT manager, to meet. However, the approach doesn't
scale at all for widespread use. In a huge corporation it is hard to distribute
such keys and, in the case of Internet commerce, it is impossible. When you want
to make a secure exchange with another party in another country whom you have
never met, and never will, there is no practical way to safely agree on secret
keys by informal communication.
Asymmetric Keys
To deal with the situation in which you can't easily distribute
the secret key, the idea of asymmetric key encryption was invented, leading to
the use of public keys. Public key encryption is supported by a set of
components often referred to as PKI (public key infrastructure).
First, let's look at the encryption part of public key use. The
very words "public key" sound like a contradiction in terms. If the key is
public, what use can it be for privacy? However, this name is misleading because
a person who uses public key encryption actually has two keys. One key is made
public and the other must be kept private. Furthermore, these are not any two
keys; the public and the private copies are a mathematically connected pair. The
way public key encryption works is fascinating and almost counterintuitive.
As an analogy, suppose a wizard wants to send you a message. He
writes the message on a piece of paper and puts it in a magic box. Now he closes
the box and recites your name three times. The box is immediately sealed and
cannot now be opened by anyone except you; not even the wizard can open it. When
the box arrives, you recite a secret word three times and the box opens. The
wizard knows your name and can seal the box with it; that is your public key.
But only you know the secret word to open the box again; that is your private
key.
How does this work with encryption? Many encryption systems are
symmetric in that the same key is used to encrypt and then decrypt the message.
However, public key systems use an asymmetrical method in which different keys
are used for encryption and decryption. You encrypt with key E and decrypt with
key D. Furthermore, you can't decrypt with key E,
and knowing E doesn't enable you to compute D. In public key encryption, E is
the spell to seal the box, or the public key. D is the spell to open the box, or
the private key.
When you want to use public key encryption through programs
such as PGP (Pretty Good Privacy), you first use a key-generating utility. You
run this utility and usually enter some personal information to help ensure your
keys are unique to you. The utility then generates two key values, a public key and a private
key. The public key can be given to anyone. And the key can be used to
encrypt a message using your public key and send it to you. Only you can decrypt
the message because only you know the private key. It's like magic!
A subtle and important variant of this method lets you sign messages. Signing a message is like signing a
document: It is intended to prove that the message came from a particular
person. Message signing works in the reverse way from encryption. You use a
private key to create a signature and a public key to check the signature. In a
simple case, you take your name and encrypt it with your private key. The result
is added to the end of your message. Anyone who receives the message (friend or
foe) can decrypt the signature using your public key. If the signature
successfully decrypts and reveals your name, it proves that you must have sent
the message because no one else knows the secret key that was used to encrypt
it. A forger could not have encrypted your name correctly because she wouldn't
know your secret key. So this proves that you approved the message in the same
way that signing a letter does—actually, much stronger.
In reality, the above scheme doesn't prevent someone from
creating a new bogus message and copying your encrypted signature from a valid
message (like photocopying your signature on a letter). To protect against this,
you must do more than include your name in the signature; you must include other
information as well. In practice, the entire contents of the message are usually
included in the signature computation to protect against tampering.
Because verifying that a message really came from the sender is
very important, systems like PGP do both encryption and message signing.
Remember that public key encryption by itself provides privacy but does not
authenticate the sender. Suppose you receive an encrypted message saying,
"Sally, come quickly, I need your help. Meet me at the bar downtown, Fred." How
do you know the message is real (ignoring the fact that your name probably isn't
Sally)? The message is encrypted with your public key, so anyone could have
forged it. A burglar may want you to leave your house, or worse. But if Fred
signed the message with his private key, you can
verify that it was really him who sent it, right?
Well, maybe … it depends. Now we are back to our original key
distribution problem. How do you know that Fred's public key really belongs to
Fred? In this case, it's probably because you met Fred face to face and he told
you the public key. Or more likely, you have had various exchanges of e-mail
with Fred using his key and you trust that it really is him. But suppose you
just started using public key yesterday and you received an e-mail (unencrypted)
from Fred two days ago that said, "Hi. This PGP stuff is cool—let's use it. My
public key is: FREDSKEY." Can you be sure that Fred sent this message and not
some (computer-literate) burglar? This is reminiscent of the sort of problem
that we had with the distribution of symmetric secret keys.
Certificates and Certification Authorities
What is needed is a way to certify that public keys are
legitimate. This issue of certifying that a
public key really belongs to the expected person becomes even more important
when you use the method for Internet transactions with complete strangers or
corporations. Think about e-commerce. You really want to be sure that the Web
site you are giving your credit card details to is who they say they are. When
your order doesn't show up, and you call to inquire, you don't want to hear,
"Sorry, we have no record of that transaction" because someone was impersonating
the vendor. The solution comes by using a trusted third party: a certificate
authority.
Essentially, a certificate
authority is a trusted independent organization that certifies a set of
public and private keys for use with PKI transactions. The authority handles
this task by generating certificates in a standard format. A certificate is just
a bunch of data. It has no physical form. However, when another party sends you
a certificate, it contains enough information for you to validate who they are
and establish a secure context. With most Web purchases, this is a one-way
context that protects the consumer. The vendor gets protection through your
credit card details!
Suppose you set up a Web company selling flags. You get a Web
domain name such as www.myflagsarebest.com. You want this address to be
certified to you so, when people come to your site and go to the secure purchase
area, they are sure that no one is hijacking the connection. You can go to a
certificate authority and purchase a certificate that binds your company and its
Web site into your public and private key pair.
When someone visits your site and goes to the secure area, you
send her your certificate. The browser on her PC looks at the certificate and
evaluates who issued it. Assuming you went to a well-known certificate
authority, the browser will likely accept the certificate as trusted (you can
control this in the advanced options of the browser). If not, it notifies the
user that an untrusted certificate has arrived and prompts her to decide whether
to proceed. The certificate contains the public key for your
site, so now the browser can start encrypting all the messages. Your Web server
is able to decrypt the messages with your private key, and so the transaction is
protected. The customer can feel confident that the credit card details and
order information are going to the right place and not being snooped along the
way.
How does the browser know that the certificate was really
issued by the certificate authority and not just made up by a crook? Because the
entire certificate is signed by the certificate authority using its private key, and therefore it can be proved
authentic because its validity can be tested by checking the signature with the
authority's public key, which is also in the certificate. Neat, huh? Note that
the browser may, in any case, choose to send a message to the certificate
authority to check for revocation. If someone had
compromised your Web site or somehow found out your secret key, you might want
to disable the certificate. This would prevent someone else issuing copies of
your certificate in the event he got your secret key. To disable the
certificate, you notify the certificate authority, which marks it as revoked and
informs anyone who asks that this is the case. It's the same idea as canceling a
stolen credit card.
This example has been simplified for the purpose of
illustrating how certificates work. Full details of Internet transactions and
security are outside the scope of this book. However, the example does outline
the general approach taken by SSL (Secure Socket Layer) used by all the main
browsers (and invented by Netscape). SSL is the basis of TLS, which is covered
in more detail later in this chapter.
A Detailed Look at Upper-Level
Authentication Methods
We have looked at an overview of two approaches: symmetric
(secret) key and asymmetric (public) key. In practice the two methods are often
combined. In particular, it is common for systems to use PKI to establish a
security context and then exchange key values and use symmetric keys for
encryption. The reason for this is that asymmetric key encryption takes more
processing power than symmetric key encryption does.
However, the distinction is useful because the two major
upper-level authentication methods we cover fall into both camps. Kerberos is
more often based on the secret key approach, while TLS is based on a certificate
approach. The following sections look at each of these methods in detail and
show how they can be incorporated into the RSN model. We also consider three
other methods, each of interest for a different reason:
-
Cisco LEAP is important because it has already been deployed
using WEP and was the first adopted method to use IEEE 802.1X and EAP.
-
Protected EAP (PEAP) is a new approach that allows complete
privacy in the authentication. Even the identity of the supplicant can be hidden
from outside observers.
-
EAP-SIM is an approach that allows cellular phone type devices
to incorporate IEEE 802.11 interfaces and authenticate using IEEE
802.1X.
Transport Layer Security (TLS)
In the early years of the World Wide Web, Netscape dominated
the design of browsers. In fact, most of the innovations in the area during
those years came from Netscape. One of those innovations related to security.
The early use of the Web was mostly technical. However, the potential for Web
trading soon became apparent. A major obstacle to trading was the problem of
securing the transaction information. Netscape invented a security approach that
came to be known as SSL to help address this problem.
SSL was based on the use of digital certificates. Although it
allows for certificates in both the server and the client, the most common model
is that the server identifies itself with a certificate and the client uses a
password or some other method such as credit card details. The use of a
certificate on the server has the tremendous advantage that purchasers do not
need to register with the site prior to making purchases. Registration is a
nuisance and it may be necessary to distribute the password by a method separate
from the Internet. Sometimes password distribution is done by post office mail.
You would have to go to the Web site and register. Then you would be mailed a
letter containing your password, which could be used to log in and make
purchases. But such delays and inconvenience put people off shopping. By
contrast, the use of certificates with SSL offers a way to identify and validate
Internet traders immediately as well as providing a secure link so sensitive
information like credit card details can be sent. No prior arrangement is
necessary, enabling the all important impulse
purchase.
SSL was built into the Netscape browser and eventually became a
standard method for secure Web transactions. It provides a way to authenticate
one or both parties and then to open a private communication channel with
encryption and integrity checking. However, although the specifications for SSL
were made available, it was still a proprietary solution controlled by a single
vendor. Vendors and customers prefer technology that is built on international
standards rather than proprietary solutions. Therefore, a decision was made to
standardize SSL (or a related version) within the IETF.
The result is TLS, which is described in IETF RFC-2246 released
in 1999. TLS is the standardized version of SSL. In fact the RFC clearly states
this in its introduction:
This document and the TLS protocol itself are based on the SSL
3.0 Protocol Specification as published by Netscape.
However, as the RFC also points out, the differences are such
that the two do not interoperate directly. TLS is entirely concerned with the
transport protocol layer and builds on to the TCP/IP layer. It does not concern
itself with browsers, operating systems, or sockets (originally a UNIX concept
but now extended to Microsoft Windows, Apple Macintosh, and other
systems).
Functions of TLS
TLS provides more services than we need for WPA/RSN upper-layer
authentication. Full TLS provides authentication, encryption, and, in principle,
data compression functions. WPA and RSN have their own built-in encryption
methods such as TKIP or AES–CCMP, and neither WPA nor RSN specifies the use of
data compression. However, the authentication method of TLS is very suitable and
fits well into the EAP/IEEE 802.1X model.
We'll look at TLS overall first before focusing on the WPA/RSN
capabilities. TLS is divided into two layers: the record protocol and the handshake protocol. The record protocol is
responsible for shifting data between the two ends of the link using the
parameters agreed via the handshake protocol.
The layers are shown diagrammatically in Figure 9.1. You can see how TLS relies on a reliable
connection such as TCP/IP to send messages backward and forward. Data comes from
the application to the TLS record protocol, where it gets encrypted and
compressed as appropriate prior to being sent to the other end. Assuming the
other end is valid, the message is then decrypted and uncompressed before
delivery.

Notice how the TLS handshake protocol also uses the record
protocol to send its messages during the handshake phase. This seems
counterintuitive because the handshake protocol is used to negotiate the
parameters of the record protocol layer over which it is communicating. TLS is
design to handle this bootstrap process; in its initial state, the record
protocol just forwards data without any encryption or compression. The record
protocol layer operates according to a group of settings or parameters called a
connection state. The connection state should
be thought of as the configuration settings for the layer. It includes things
like "which encryption algorithm is in use" and "what are the encryption keys."
The record protocol layer can store four connection states: two connection
states for each direction of communication. Two of the states are current and
two are pending, as follows:
-
Current transmit connection state
-
Pending transmit connection state
-
Current receive connection state
-
Pending receive connection state
The difference between current and pending is quite simple.
Current refers to the settings that are in effect now. Pending is a group of
settings that are being prepared for use next. When the change occurs, the
pending state becomes the current state and a new empty pending set is created,
as shown in Figure 9.2. When the
connection is first initialized, the current state is NULL: Everything just
passes through. There are no keys, no encryption method, and no compression.
During this time the handshake protocol can operate and build up the security
parameters in the pending states. When everything is ready, the pending states
become the current states and the security goes into effect.

TLS uses certificates for authentication (see the discussion of
certificates earlier in the chapter). There are a number of different types of
certificate, all working on similar principles. TLS is flexible enough to deal
with all the cases, but it makes reading the TLS specification rather tedious.
Suffice it to say, a certificate is typically delivered by the server for the
client to verify. In rare applications, the server may also request a
certificate from the client. Client certificates are typically used only when
there is an in-house certificate authority—for
example, when a corporation issues its own certificates for its employees.
Certificates are based on public key cryptography. It is a
clever technique, but it is expensive in processing requirements. The nature of
public key crypto methods means that many more computations are needed to encode
and decode messages than for symmetric key operations. As a result, TLS does not
use public key encryption for bulk data transfers of the record layer; instead,
it uses symmetric keys that are agreed upon between the parties during the
public key phase. The handshake protocol uses the certificates to perform public
key cryptography during the authentication process. It also uses the public key
cryptography to exchange some session keys that can be used by the record layer
to encrypt data during the session. This approach greatly reduces the workload
and, as it happens, fits in very nicely with the way in which WPA/RSN is
organized.
Handshake Exchange
A relationship is established between two parties in TLS by
using a handshake exchange. This involves a series of messages sent between the
parties in a specific order, as summarized in Figure 9.3 and explained in the following sections.

There are several options concerning which messages are sent
and what information they contain, but the order is important and, before the
end of the handshake, every message is checked for validity. At the start of the
handshake, the two parties exchange hello
messages, rather like people actually. Remember that TLS is not
symmetrical, so one party must take the role of the server and the other the
client. Ideally, the client should send the hello message first.
Client Hello (client
server)
The client hello is more than just a courtesy message; it
contains a list of the ciphersuites and compression methods that the client can
support. A cipher suite is a combination of cryptographic methods used together
to perform security. In TLS the ciphersuite defines the type of certificates,
the encryption method, and the integrity-checking method. The TLS RFC defines
some standard combinations, and the client can indicate which ones it supports,
in order of preference. Importantly, the Client Hello also carries a random
number called ClientHello.random, which can be any value but should be
completely unpredictable to everyone (except the client). This random number is
used to generate liveness.
|
When watching sports on TV, you will often hear reference to a
live broadcast. This means the broadcast is happening in real time and is not a
recording made earlier. It is in this context that we refer to liveness in
security. You need to know that the negotiation is live and that you are not
dealing with a recording of a previous exchange. Generating and incorporating a
different number with each session makes it much harder to use recorded data in
an attack. A truly random number has the disadvantage that there is a small
probability that the same value will occur twice. A number that is guaranteed
never to be used again is called a nonce. |
Server Hello (server
client)
When the server receives the Client Hello message, it must
check that it is able to support one of the chosen ciphersuites and compression
methods; then it replies with a Server Hello message. The Server Hello contains
two more important items. First, it contains another random number, called
ServerHello.random, which is different from the client's random value. Second,
it contains a session ID that the client and server use to refer to the session
from then on. One of the features of TLS is that a security session, once
established, can be resumed multiple times by the
client indicating current session ID in the Client Hello message. This is useful
for browsers to quickly return to pages that have already been visited. At this
stage the client and server have exchanged greetings with the result:
-
They have synchronized their states.
-
They have agreed on a session ID.
-
They have agreed on a ciphersuite.
-
They have exchanged two random numbers
(nonces).
"Synchronizing their states" simply means that they both have
the same understanding of what is going on. It's no good if one thinks the
handshake is just starting and the other thinks it's nearly finished. Also,
during the handshake both the client and the server must carefully keep copies
of all the messages they have sent or received. At the end of the handshake,
they will be required to prove that they have these copies to help ensure that
no one has altered or inserted any messages.
Server Certificate (server
client)
The next phase involves the certificate exchanges. If the
session is being resumed, this stage can be skipped. The server sends its
certificate to the client. Remember that there are two important things in the
certificate. First, it contains the name and public key of the server. These can
be used to encrypt messages to the server and validate signed messages from the
server. Second, it is signed by a certificate authority to prove that it is
authentic. The client validates the certificate using the certificate
authority's public key and then remembers the server's public key to encrypt
further messages to the server. Although a bogus server could copy and send the
valid certificate, it would not subsequently be able to decrypt the correct
pre-master secret because it does not have the secret part of the public/private
key pair.
Client Certificate (client
server)
The server may require the client to send a certificate. For
Web browsing applications, it is unusual for the client to have a
certificate—though this might change in the future as credit card use becomes
more integrated with Web security. Already some services have emerged that allow
members of the public to register and obtain digital certificates, which may
then be used for access to subscription services. However, the financial
industry is reluctant to adopt new technology too quickly, for very good
reasons. The majority of transactions are still done using the traditional (and
pitifully insecure) method of giving a credit card number and expiry date,
albeit over a secure communications channel. For these types of transaction, the
server sends a certificate but the client does not.
If a corporation is using TLS for internal network security, it
might choose to give out certificates to its own employees. In this case, the IT
department becomes a certificate authority and issues certificates for its own
servers and all the users. If this approach is taken, the server can be
configured to request a certificate from the user. The fact that the client
produces a certificate proves nothing, of course, because it could easily have
been copied from a previous session. However, the client can subsequently prove
that it also has the certificate secret key by digitally signing a message to
the server. This is done in the certificate verify stage that we explore
later.
So far the client and server have exchanged hello messages. The
server has sent a certificate and may have requested the client to do the same.
At this point the server sends a Server Hello Done
message and waits for the client to take the next step. If the server
requested a certificate, the first thing the client should do is send it over;
it will be checked later. Now comes the interesting part: The client and server
establish a mutual secret key for use in further communications.
Client Key Exchange (client
server)
The goal of this phase is to create a mutual secret key between
the client and the server, called the master secret. This key binds together the
random numbers that were exchanged in the hello message with a secret value that
is created dynamically and known only by the two parties (the client and the
server). Note that the random numbers (nonces) sent during the hello phase could
be seen by anybody monitoring the link; they are exchanged in the clear and not
encrypted. By contrast, the random value created at this stage is known as the
pre-master secret to reflect the fact that it
is secret and will be used to generate the master key. The simplest way to
generate the pre-master key and get it securely to both the server and the
client is to take advantage of the server's certificate. The client simply
generates a random number (48 bytes), encrypts it using the server's public key,
and sends it to the server using a client key
exchange message. The server decrypts it with its private key and, bingo,
both sides have the pre-master secret.
Client Certificate Verification
If the client sent a certificate, now is the time for it to
prove that it is the legal owner of that certificate. This is where those copies
of all the messages come in useful. The client proves itself by hashing together
all the messages up to this point (see the sidebar "A Note on Hashing"), including both the ones sent and the
ones received. It then sends the result to the server and signs the message with the secret key of its
certificate. The server receives the message and checks the signature using the
client's public key as delivered in the client's certificate. If the signature
checks out, the server also computes the hash of messages and checks that the
result matches. If the signature or the hash check fails, the server should
assume that the client is bogus. If it checks out, the server can be sure that
the client knows the secret key for the certificate.
The client and server are now in a position to compute the
master secret. The details of how this is done are rather complicated, but the
concept is simple. Both parties have the following identical information:
They both now cryptographically combine these values by hashing
to produce a 48-byte (384-bit) master key. Because they both have the same
values and use the same algorithm, they will, of course, both compute the same
key. The incorporation of the random numbers ensures liveness and guarantees
that no one can use a recording of a previous exchange. The quality of the random number generator on both sides
needs to be high. Some so-called random numbers generate a random distribution
of numbers, but in an entirely predictable way. For example, the Rand() function
available in many programming languages always produces the same "random"
sequence after initialization. The random number used in security must really be unpredictable even after
reinitialization.
|
Hashing is an operation used frequently in cryptography. Its
purpose is to combine two or more numbers to produce a result in such a way that
it is extremely hard or impossible to reverse the process. In other words, if A
and B are hashed together to produce the result C, then knowledge of C tells you
nothing about A or B.
Consider normal arithmetic. The basic adding rule is a + b = c. If we know a and b, we can
easily work out c. However, if we know b and c, we can, as
easily, work out a (a
= c – b). Hash algorithms do not have this reversible property. So a hash b = c may be easy to compute; but given b and c, it is
effectively impossible to work out a.
One application of hashing is to protect a master key by
generating a temporary session key. Suppose a =
128-bit master key and b = time of day,
then you could generate a new 128-bit key c by
hashing together a and b. Even if the attacker knows the time of day and
discovers the new key c, he cannot derive the
original master key. In this example the new key is the same length as the
original one.
Another use of hashes is to combine a large number of bits into
a small number. This is used to generate messages' integrity checks. Suppose you
hash a 1,000-byte message (8,000 bits) with a secret key to produce a result,
which is only 64 bits long. Given the result, an attacker cannot compute the
secret key or the original message. However, there is only one correct result
that corresponds to the message. By sending the result with the message, the
receiver can check that a message is intact and unaltered. Even if a single bit
of the 1,000-byte message was altered, the resulting 64-bit hash result would be
totally different. |
Change Connection State
The object of the handshake has been to authenticate and create
a new pending connection state ready to be
turned on when all the keys and other required information have been obtained.
Remember that there is a current state and a pending state. After
initialization, the current state is "no encryption." The master key that has
been created is now used to initialize the pending state according to the cipher
suite in use. How this is done depends of the details of the cipher suite. For
example, the cipher might not need all 384 bits of the master key or will want
to derive different keys for receive and transmit, which it can do by further
hashing the master key. This is done in WPA/RSN, for example. Suffice it to say
that once the master key is established, both the client and the server are able
to fully set up the pending connection state and then switch it to become the
current state. When the switch is performed, each side sends a change connection state message to the other.
Finished
The handshake performs one more operation before
completing—confirming that the new cipher suite is operating and that there was
no tampering with any of the handshake messages. Each side sends a finished
message for this purpose. Remember that the new cipher suite has now been
activated, so this message will be encrypted with the new master key. The
finished message contains a hash value covering the new master secret and all
the handshake messages that have been exchanged from the hello message up to
(but not including) the finished message. Assuming the message is received
correctly, the new cipher suite is operational. The receiving party can compute
the corresponding hash value from its own records and check that the result
matches. If it does, everything is valid and it is safe to start passing data
using the new master key.
If the TLS session was being resumed, the client and server go
straight from the hello message to the finished message, computing a new master
key from the new random numbers (in the hello messages) and the old master
secret. This process avoids the expensive certificate operations but still
prevents bogus clients or servers because knowledge of the pre-master secret is
exclusively held by the original authenticated client and server.
Relationship of TLS Handshake and WPA/RSN
This TLS handshake process accomplishes three things:
-
It has authenticated the server (and optionally the
client).
-
It has generated a secret master key for the session.
-
It has initialized and put into effect a ciphersuite to protect
communications.
Now we need to consider how this method can be applied to
support WPA or IEEE 802.11i RSN networks. In WPA, encryption and integrity
protection is provided by WEP or TKIP. RSN may support TKIP or AES–CCMP. These
functions operate only between an access point and a wireless device. The TLS
handshake described here is exclusively concerned with two parties: the
authentication server and the client. There is no mention of the three-way model
we have adopted for IEEE 802.1X with a supplicant, authenticator, and
authentication server.
For WPA and RSN, all we need from TLS is the authentication
function and the master key generation function. WPA/RSN deals with its own
cipher suites. WPA/RSN takes the master secret generated by TLS and then derives
a set of keys for use in encrypting the wireless link (see Chapter 10). In this case, although the
master key is generated, the TLS record protocol connection state is not
updated—that is, for WPA/RSN we don't use the TLS record protocol for
encryption; we just hijack its handshake exchange to generate a secure master
key.
In this way, TLS does integrate well with the IEEE 802.1X model
and is specified to run over EAP. It is the default mandatory mode for
WPA.
TLS over EAP
Although the designers of TLS probably thought that it would
most often be used over a TCP/IP connection, they defined it in a more general
way. RFC2246 simply says:
At the lowest level, layered on top of some reliable transport
protocol (e.g., TCP), is the TLS Record Protocol.
The key words are "layered on top of some reliable transport
protocol." This general definition left the door open to implement parts of TLS
directly over EAP—"parts" because EAP does not deal with normal data transfer;
it is specifically concerned with the authentication phase. When we use TLS in
conjunction with WPA/RSN, we want it to run over EAP because that allows us to
tie it into the IEEE 802.1X.
RFC2716, PPP EAP TLS Authentication Protocol, defines how to
perform the TLS handshake over EAP. As the name suggests, it was originally
considered (like EAP itself) in the context of dial-in access authentication
using PPP. But we can adapt it for use also with IEEE 802.1X and RSN.
EAP always starts and ends with a similar sequence. Usually, an
identity request/response message is exchanged. Then a series of EAP requests
and responses are sent that are specific to the authentication method, as
identified by a Type field in each message. Finally an EAP-Success or
EAP-Failure message is sent to indicate the result (see Chapter 8 for more detail on these
structures). RFC2716 defines all the middle messages that we were somewhat vague
about in Chapter 8. The
general format of the EAP-Request/Response messages is shown in Figure 9.4.

For TLS, the RFC defines the Type field for these EAP requests
and responses to be the value 13. Only clients and servers that understand
EAP-TLS will attempt to decode these messages. RFC2716 also defines two new
fields to go after the Type field. These fields are Flags and Length, as shown
in Figure 9.5.

Why does length appear twice? The first Length field refers to
the length of this EAP frame. However, the second Length field refers to the
length of an EAP-TLS packet. EAP-TLS packets can be quite long, exceeding the
maximum size of an EAP message. In such a case, the EAP-TLS packet is
fragmented—that is, broken into multiple pieces—and sent in several exchanges.
The second length value, in the TLS field, refers to the overall TLS message and
not the current frame. Actually this second Length field is optional and is not
normally included if the EAP-TLS data fits into the current frame.
The Flags field contains three bits:
-
Length included flag:
Indicates whether the Length field is present
-
More fragments flag: Set if
more fragments are to follow in subsequent exchanges
-
Start flag: Used to signal
start of handshake
The sequence of exchanges that make up the EAP-TLS handshake
are outlined in Figure 9.6. We assume
that the server has become aware of the client through some method such as
EAP-Start. Study the diagram for a minute before we work through it. Here is a
commentary of the steps:
-
{request} This is the start of the EAP exchange. Server
requests identity of client.
-
{response} Here the client sends an identity message. For
corporate use, this could identify the owner of the client certificate that will
be sent. If the client does not intend to send a certificate, it will
effectively be anonymous and could therefore send any identity here, such as the
string "anonymous".
-
{request} The server sends an empty EAP-TLS request with the
flag bit start set. This is the only time the start bit is set.
-
{response} The client sends it Client Hello message containing
the same information as for normal TLS.
-
{request} The server sends two or three TLS messages in a
single request: The server hello, optionally the client certificate request, and
the server finished message.
-
{response} The client now replies with several TLS messages in
a single response:
-
Client certificate (if requested)
-
Pre-master secret in key exchange message
-
Client certificate verification information
-
Change cipher
-
Finished
Notice how the client goes ahead, creates the pre-master
secret, computes the master secret, and "puts the cipher into effect," all in
one go. However, note that the entire EAP message is sent in the original
ciphersuite, which is usually open (that is, no encryption). The new ciphersuite
is not put into effect until after the end of the EAP messages.
-
{request} The server sends all its remaining messages in a
single EAP request.
-
{response} The client has nothing more to say but must respond
so it sends an empty response message.
-
Finally to complete the EAP handshake, the server sends an
EAP-Success, assuming everything has gone well. If any of the steps failed, the
server would have previously sent an EAP-Fail at the point the problem was
detected.

The use of EAP provides the key for implementing TLS with WPA
or RSN. For one thing, the use of EAP means that no IP address is needed and the
wireless device can exchange EAP messages to the access point and perform the
entire handshake prior to being granted access to the wired network. The access
point does not need to understand TLS to complete the transaction, providing it
has an authentication server on the network to which to send the EAP messages.
And the access point can watch out for the EAP-Success message to learn when it
should connect the IEEE 802.1X switch and allow access to the network. However,
there are still two unanswered questions:
The answer to these questions lies in the use of RADIUS (see Chapter 8). RADIUS is a
protocol that allows a device to communicate with an authentication server. It
has been much extended over the years although the basic principles are
unchanged. One of the key enhancements in relation to WPA/RSN was the inclusion
of messages that allow the forwarding of EAP requests and responses directly to
the server. The issue of how to get the master key back to the access point is
not one that is currently covered by the RADIUS RFCs. Also it is not covered
directly by the IEEE 802.11 standard because this is out of scope for the
standard. However, WPA specifies the use of a specific Microsoft-defined
attribute to ensure interoperability between vendors. This turns out to be the
same attribute that is already used in a similar way to send key information to
a dial-up modem pool.
Summary of TLS
This section describes how TLS works. TLS is not specifically
designed for use with wireless networks. It is based on SSL, a security method
used at the application level. However, the invention of a method to support TLS
over EAP, combined with changes to the RADIUS protocol to support EAP over
RADIUS, has opened a path whereby WPA and RSN can build on the substantial
existing support for the protocol. SSL is very widely deployed in Web browsers
and servers and it is highly proven. Certificate authorities are well
established and provide the infrastructure needed for SSL operation. Now the
adoption of TLS for WPA will take advantage of SSL's success.
The next section looks at another popular authentication
approach—Kerberos V5. Although this has not been specified for WPA, it is still
a viable option for RSN and may be more appropriate for customers that already
have extensive Kerberos installations.
Kerberos
Kerberos can be used to provide security services for an IP
network and has been around for a relatively long time. The early work was done
at Massachusetts Institute of Technology during the 1980s and subsequently it
went through various stages of standardization in the IETF (Neuman and Ts'o, 1994).
Version 5, the current major version, was issued in RFC1510 in 1993. This RFC
has stood up well to practical implementation and has needed little modification
although there are several more recent extensions. By the way, no introduction
to Kerberos seems to be complete without mentioning that the name "Kerberos"
comes from the three-headed dog that guarded the gates to Hades in Greek
mythology, although which particular hell is guarded in the case of network
security is not obvious to us.
Using Tickets
The really good idea in Kerberos is that credentials can be
embedded into a special document called a ticket. In much the same way that you
can go to Orlando, Florida, and buy a week-long multipark ticket to
mouse-related theme parks, a Kerberos ticket provides a network user access to a
variety of network services for a limited period of time.
Let's consider a network of separately administered servers in
a large campus using password-based authentication. To access several services,
you would need to log in separately to each service, such as the e-mail server,
file servers, the database server, printers, and so on. Each time you logged in,
your session would be interrupted and you would have to type a password. In the
worst case, you would have to know a different password for each service or, if
you have a single password, the service itself would have to go back to some
central authority to verify your credentials. This approach places the onus on
the network servers to check you out every time you ask for access. Checking
credentials can be a time-consuming task and, frankly, servers have better
things to do with their time.
The situation gets worse if there are different authentication
servers for different network domains. Now the server has to go to its local
authentication server to check you out and that server might need to go back to
your home server to complete the check. As the network grows, this process
becomes an unmanageable mess.
Using tickets greatly simplifies the process, which starts with
a master access ticket that your computer must get when you first join the
network. Before your computer can get the first ticket, you have to prove your
identity, in other words, perform master authentication. However, once you are
validated, your computer gets the master ticket, establishing a security
context. This ticket can now be used to get other tickets specific to the
services you want. Your computer can usually handle that task without
interrupting you.
Once your computer has a ticket for a particular service, it
presents the ticket to that service to get access. Now the onus is on your
computer to get the tickets and the load is taken off the services. All the
services do is validate a ticket when it is presented, which they can usually do
locally and without referring to any other authority.
This description is somewhat simplified, but all the key
principles are here. Most of the rest of Kerberos is concerned with ticket
management and deals with special cases like cross-domain access and ticket
referral (more later). There are a couple of aspects of Kerberos that are
problematic (Bellovin and Merritt,
1991).
The first issue is that Kerberos is essentially password based.
There have been schemes designed that allow the use of digital certificates with
Kerberos, but the predominant model is that of an actual person using the
computer. People are able to enter a user password from memory when prompted.
Today many network devices are machines, not people; and the password model does
not work so well with machines because stored passwords are subject to attack
while stored on a machine.
The second issue is that dictionary attacks were not considered
a serious threat 20 years ago. In this type of attack, the enemy holds a
database with hundreds of millions of passwords—the sort of passwords humans
tend to make up and various combinations of them. The attack simply involves
trying every password. This is a threat if it can be performed offline. In other words, if you can record the messages
from an encrypted logon and then go home and run your attack against the
recording rather than the real system. Kerberos can be vulnerable to this type
of attack unless special steps are taken.
Kerberos Tickets
A ticket is just a piece of data in a special format. All
Kerberos tickets have the same basic structure but, to help the explanation,
we'll say that there are three types of ticket:
-
Ticket-granting
-
Service access
-
Referral
The introduction to this chapter notes that a master ticket
must be obtained before all others. In Kerberos there is nothing quite so strong
as a master ticket but, instead, there is a similar concept called a ticket-granting ticket (TGT). The ticket-granting
ticket lets you get other tickets from a key distribution center (KDC) for the
local security domain (called "realm" in Kerberos).
Obtaining the Ticket-Granting Ticket
When a computer (the client) first connects to the network, it
has to contact a KDC to obtain a TGT. The KDC has two parts: an authentication
service (AS) and a ticket-granting service (TGS), as shown in Figure 9.7.

It is the job of the authentication server to check the client
and confirm that it is allowed access to the network. Kerberos uses the approach
of shared secrets. The client has some secret
information and a copy of this information is stored in a protected user
datab