The use of the AT_ANY_ID_REQ is defined in Section 4.2. The value
field contains only two reserved bytes, which are set to zero on
sending and ignored on reception.
10.7. AT_FULLAUTH_ID_REQ
The format of the AT_FULLAUTH_ID_REQ attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|AT_FULLAUTH_...| Length = 1 | Reserved |
+---------------+---------------+-------------------------------+
The use of the AT_FULLAUTH_ID_REQ is defined in Section 4.2. The
value field contains only two reserved bytes, which are set to zero
on sending and ignored on reception.
10.8. AT_IDENTITY
The format of the AT_IDENTITY attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_IDENTITY | Length | Actual Identity Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. Identity (optional) .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The use of the AT_IDENTITY is defined in Section 4.2. The value
field of this attribute begins with a 2-byte actual identity length,
which specifies the length of the identity in bytes. This field is
followed by the subscriber identity of the indicated actual length.
The identity is the permanent identity, a pseudonym identity, or a
fast re-authentication identity. The identity format is specified in
Section 4.2.1. The same identity format is used in the AT_IDENTITY
attribute and the EAP-Response/Identity packet, with the exception
that the peer MUST NOT decorate the identity it includes in
AT_IDENTITY. The identity does not include any terminating null
characters. Because the length of the attribute must be a multiple
of 4 bytes, the sender pads the identity with zero bytes when
necessary.
10.9. AT_RAND
The format of the AT_RAND attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_RAND | Length | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. n*RAND .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of this attribute contains two reserved bytes
followed by n GSM RANDs, each 16 bytes long. The value of n can be
determined by the attribute length. The reserved bytes are set to
zero upon sending and ignored upon reception.
The number of RAND challenges (n) MUST be two or three. The peer
MUST verify that the number of RAND challenges is sufficient
according to the peer’s policy. The server MUST use different RAND
values. In other words, a RAND value can only be included once in
AT_RAND. When processing the AT_RAND attribute, the peer MUST check
that the RANDs are different.
The EAP server MUST obtain fresh RANDs for each EAP-SIM full
authentication exchange. More specifically, the server MUST consider
RANDs it included in AT_RAND to be consumed if the server receives an
EAP-Response/SIM/Challenge packet with a valid AT_MAC, or an
EAP-Response/SIM/Client-Error with the code "insufficient number of
challenges" or "RANDs are not fresh". However, in other cases (if
the server does not receive a response to its
EAP-Request/SIM/Challenge packet, or if the server receives a
response other than the cases listed above), the server does not need
to consider the RANDs to be consumed, and the server MAY re-use the
RANDs in the AT_RAND attribute of the next full authentication
attempt.
10.10. AT_NEXT_PSEUDONYM
The format of the AT_NEXT_PSEUDONYM attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_NEXT_PSEU..| Length | Actual Pseudonym Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. Next Pseudonym .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of this attribute begins with the 2-byte actual
pseudonym length, which specifies the length of the following
pseudonym in bytes. This field is followed by a pseudonym username
that the peer can use in the next authentication. The username MUST
NOT include any realm portion. The username does not include any
terminating null characters. Because the length of the attribute
must be a multiple of 4 bytes, the sender pads the pseudonym with
zero bytes when necessary. The username encoding MUST follow the
UTF-8 transformation format [RFC3629]. This attribute MUST always be
encrypted by encapsulating it within the AT_ENCR_DATA attribute.
10.11. AT_NEXT_REAUTH_ID
The format of the AT_NEXT_REAUTH_ID attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_NEXT_REAU..| Length | Actual Re-Auth Identity Length|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. Next Fast Re-authentication Username .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of this attribute begins with the 2-byte actual
re-authentication identity length which specifies the length of the
following fast re-authentication identity in bytes. This field is
followed by a fast re-authentication identity that the peer can use
in the next fast re-authentication, as described in Section 5. In
environments where a realm portion is required, the fast
re-authentication identity includes both a username portion and a
realm name portion. The fast re-authentication identity does not
include any terminating null characters. Because the length of the
attribute must be a multiple of 4 bytes, the sender pads the fast
re-authentication identity with zero bytes when necessary. The
identity encoding MUST follow the UTF-8 transformation format
[RFC3629]. This attribute MUST always be encrypted by encapsulating
it within the AT_ENCR_DATA attribute.
10.12. AT_IV, AT_ENCR_DATA, and AT_PADDING
AT_IV and AT_ENCR_DATA attributes can be used to transmit encrypted
information between the EAP-SIM peer and server.
The value field of AT_IV contains two reserved bytes followed by a
16-byte initialization vector required by the AT_ENCR_DATA attribute.
The reserved bytes are set to zero when sending and ignored on
reception. The AT_IV attribute MUST be included if and only if the
AT_ENCR_DATA is included. Section 6.3 specifies the operation if a
packet that does not meet this condition is encountered.
The sender of the AT_IV attribute chooses the initialization vector
at random. The sender MUST NOT re-use the initialization vector
value from previous EAP-SIM packets. The sender SHOULD use a good
source of randomness to generate the initialization vector. Please
see [RFC4086] for more information about generating random numbers
for security applications. The format of AT_IV is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_IV | Length = 5 | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Initialization Vector |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of the AT_ENCR_DATA attribute consists of two
reserved bytes followed by cipher text bytes encrypted using the
Advanced Encryption Standard (AES) [AES] with a 128-bit key in the
Cipher Block Chaining (CBC) mode of operation using the
initialization vector from the AT_IV attribute. The reserved bytes
are set to zero when sending and ignored on reception. Please see
[CBC] for a description of the CBC mode. The format of the
AT_ENCR_DATA attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_ENCR_DATA | Length | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. Encrypted Data .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The derivation of the encryption key (K_encr) is specified in Section
7.
The plaintext consists of nested EAP-SIM attributes.
The encryption algorithm requires the length of the plaintext to be a
multiple of 16 bytes. The sender may need to include the AT_PADDING
attribute as the last attribute within AT_ENCR_DATA. The AT_PADDING
attribute is not included if the total length of other nested
attributes within the AT_ENCR_DATA attribute is a multiple of 16
bytes. As usual, the Length of the Padding attribute includes the
Attribute Type and Attribute Length fields. The length of the
Padding attribute is 4, 8, or 12 bytes. It is chosen so that the
length of the value field of the AT_ENCR_DATA attribute becomes a
multiple of 16 bytes. The actual pad bytes in the value field are
set to zero (00 hexadecimal) on sending. The recipient of the
message MUST verify that the pad bytes are set to zero. If this
verification fails on the peer, then it MUST send the
EAP-Response/SIM/Client-Error packet with the error code "unable to
process packet" to terminate the authentication exchange. If this
verification fails on the server, then the server sends the peer the
EAP-Request/SIM/Notification packet with an AT_NOTIFICATION code that
implies failure to terminate the authentication exchange. The format
of the AT_PADDING attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_PADDING | Length | Padding... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10.13. AT_RESULT_IND
The format of the AT_RESULT_IND attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_RESULT_...| Length = 1 | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of this attribute consists of two reserved bytes,
which are set to zero upon sending and ignored upon reception. This
attribute is always sent unencrypted, so it MUST NOT be encapsulated
within the AT_ENCR_DATA attribute.
10.14. AT_MAC
The AT_MAC attribute is used for EAP-SIM message authentication.
Section 8 specifies in which messages AT_MAC MUST be included.
The value field of the AT_MAC attribute contains two reserved bytes
followed by a keyed message authentication code (MAC). The MAC is
calculated over the whole EAP packet and concatenated with optional
message-specific data, with the exception that the value field of the
MAC attribute is set to zero when calculating the MAC. The EAP
packet includes the EAP header that begins with the Code field, the
EAP-SIM header that begins with the Subtype field, and all the
attributes, as specified in Section 8.1. The reserved bytes in
AT_MAC are set to zero when sending and ignored on reception. The
contents of the message-specific data that may be included in the MAC
calculation are specified separately for each EAP-SIM message in
Section 9.
The format of the AT_MAC attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_MAC | Length = 5 | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| MAC |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The MAC algorithm is an HMAC-SHA1-128 [RFC2104] keyed hash value.
(The HMAC-SHA1-128 value is obtained from the 20-byte HMAC-SHA1 value
by truncating the output to the first 16 bytes. Hence, the length of
the MAC is 16 bytes. The derivation of the authentication key
(K_aut) used in the calculation of the MAC is specified in Section 7.
When the AT_MAC attribute is included in an EAP-SIM message, the
recipient MUST process the AT_MAC attribute before looking at any
other attributes, except when processing EAP-Request/SIM/Challenge.
The processing of EAP-Request/SIM/Challenge is specified in Section
9.3. If the message authentication code is invalid, then the
recipient MUST ignore all other attributes in the message and operate
as specified in Section 6.3.
10.15. AT_COUNTER
The format of the AT_COUNTER attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_COUNTER | Length = 1 | Counter |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of the AT_COUNTER attribute consists of a 16-bit
unsigned integer counter value, represented in network byte order.
This attribute MUST always be encrypted by encapsulating it within
the AT_ENCR_DATA attribute.
10.16. AT_COUNTER_TOO_SMALL
The format of the AT_COUNTER_TOO_SMALL attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_COUNTER...| Length = 1 | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of this attribute consists of two reserved bytes,
which are set to zero upon sending and ignored upon reception. This
attribute MUST always be encrypted by encapsulating it within the
AT_ENCR_DATA attribute.
10.17. AT_NONCE_S
The format of the AT_NONCE_S attribute is shown below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_NONCE_S | Length = 5 | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| |
| NONCE_S |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The value field of the AT_NONCE_S attribute contains two reserved
bytes followed by a random number freshly generated by the server (16
bytes) for this EAP-SIM fast re-authentication. The random number is
used as a challenge for the peer and also as a seed value for the new
keying material. The reserved bytes are set to zero upon sending and
ignored upon reception. This attribute MUST always be encrypted by
encapsulating it within the AT_ENCR_DATA attribute.
The server MUST NOT re-use the NONCE_S value from any previous
EAP-SIM fast re-authentication exchange. The server SHOULD use a
good source of randomness to generate NONCE_S. Please see [RFC4086]
for more information about generating random numbers for security
applications.