libosmogsm 1.13.1.1-afb4 Osmocom GSM library

Files | Data Structures | Enumerations | Functions
Osmocom Authentication Protocol

The Osmocom Authentication Protocol (OAP) is a way to use the 3GPP AKA (Authentication and Key Agreement) as cryptographic authentication mechanism in other protocols that don't provide cryptographic authentication. More...

## Files
file | oap.h
file | oap.c
| Osmocom Authentication Protocol.

## Data Structures
struct | osmo_oap_message
| Parsed/decoded OAP protocol message. More...

## Enumerations
enum | osmo_oap_iei { OAP_CAUSE_IE = 0x02 , OAP_RAND_IE = 0x20 , OAP_AUTN_IE = 0x23 , OAP_XRES_IE = 0x24 , OAP_AUTS_IE = 0x25 , OAP_CLIENT_ID_IE = 0x30 }
| Information Element Identifiers for OAP IEs. More...
enum | osmo_oap_message_type { OAP_MSGT_REGISTER_REQUEST = 0b00000100 , OAP_MSGT_REGISTER_ERROR = 0b00000101 , OAP_MSGT_REGISTER_RESULT = 0b00000110 , OAP_MSGT_CHALLENGE_REQUEST = 0b00001000 , OAP_MSGT_CHALLENGE_ERROR = 0b00001001 , OAP_MSGT_CHALLENGE_RESULT = 0b00001010 , OAP_MSGT_SYNC_REQUEST = 0b00001100 , OAP_MSGT_SYNC_ERROR = 0b00001101 , OAP_MSGT_SYNC_RESULT = 0b00001110 }
| OAP message types. More...

## Functions
int | osmo_oap_decode (struct osmo_oap_message *oap_msg, const uint8_t *const_data, size_t data_len)
| Decode OAP message data. More...
void | osmo_oap_encode (struct msgb *msg, const struct osmo_oap_message *oap_msg)
| Compose OAP message data. More...

## Detailed Description

The Osmocom Authentication Protocol (OAP) is a way to use the 3GPP AKA (Authentication and Key Agreement) as cryptographic authentication mechanism in other protocols that don't provide cryptographic authentication.

## Enumeration Type Documentation

## ◆ osmo_oap_iei

enum osmo_oap_iei

Information Element Identifiers for OAP IEs.

They match osmo_gsup_iei (so far).

Enumerator
OAP_CAUSE_IE |
OAP_RAND_IE |
OAP_AUTN_IE |
OAP_XRES_IE |
OAP_AUTS_IE |
OAP_CLIENT_ID_IE |

## ◆ osmo_oap_message_type

enum osmo_oap_message_type

OAP message types.

Enumerator
OAP_MSGT_REGISTER_REQUEST |
OAP_MSGT_REGISTER_ERROR |
OAP_MSGT_REGISTER_RESULT |
OAP_MSGT_CHALLENGE_REQUEST |
OAP_MSGT_CHALLENGE_ERROR |
OAP_MSGT_CHALLENGE_RESULT |
OAP_MSGT_SYNC_REQUEST |
OAP_MSGT_SYNC_ERROR |
OAP_MSGT_SYNC_RESULT |

## Function Documentation

## ◆ osmo_oap_decode()

int osmo_oap_decode | ( | struct osmo_oap_message * | oap_msg,
|  | const uint8_t * | const_data,
|  | size_t | data_len
| ) |  |

Decode OAP message data.

Parameters

  [out] | oap_msg | Parsed data is written to this instance.
  [in] | data | Pointer to the data buffer containing the OAP message.
  [in] | data_len | Length of the OAP message data.

Returns
  0 on success, a negative cause value on failure.

References osmo_oap_message::autn, osmo_oap_message::autn_present, osmo_oap_message::auts, osmo_oap_message::auts_present, osmo_oap_message::cause, osmo_oap_message::client_id, data, DLOAP, GMM_CAUSE_INV_MAND_INFO, GMM_CAUSE_PROTO_ERR_UNSPEC, iei, LOGL_ERROR, LOGL_NOTICE, LOGP, osmo_oap_message::message_type, OAP_AUTN_IE, OAP_AUTS_IE, OAP_CAUSE_IE, OAP_CLIENT_ID_IE, OAP_RAND_IE, OAP_XRES_IE, osmo_decode_big_endian(), osmo_shift_tlv(), osmo_shift_v_fixed(), osmo_oap_message::rand, osmo_oap_message::rand_present, osmo_oap_message::xres, and osmo_oap_message::xres_present.

Referenced by osmo_oap_client_handle().

## ◆ osmo_oap_encode()

void osmo_oap_encode | ( | struct msgb * | msg,
|  | const struct osmo_oap_message * | oap_msg
| ) |  |

Compose OAP message data.

Parameters

  [out] | msg | OAP message data is appended to this message buffer.
  [in] | oap_msg | Elements to encode in the message data.

References osmo_oap_message::autn, osmo_oap_message::autn_present, osmo_oap_message::auts, osmo_oap_message::auts_present, osmo_oap_message::cause, osmo_oap_message::client_id, osmo_oap_message::message_type, msg, msgb_tlv_put(), msgb_v_put(), OAP_AUTN_IE, OAP_AUTS_IE, OAP_CAUSE_IE, OAP_CLIENT_ID_IE, OAP_RAND_IE, OAP_XRES_IE, OSMO_ASSERT, osmo_encode_big_endian(), osmo_oap_message::rand, osmo_oap_message::rand_present, osmo_oap_message::xres, and osmo_oap_message::xres_present.

Referenced by osmo_oap_client_encoded().