mirror of
https://github.com/coturn/coturn.git
synced 2025-10-29 22:11:11 +01:00
oauth
This commit is contained in:
parent
6aa1af102c
commit
87f1b41382
@ -2,7 +2,6 @@
|
|||||||
Version 4.2.1.1 'Monza':
|
Version 4.2.1.1 'Monza':
|
||||||
- oAuth security implementation:
|
- oAuth security implementation:
|
||||||
TODO:
|
TODO:
|
||||||
- clients's check_integrity method();
|
|
||||||
- security dialog;
|
- security dialog;
|
||||||
- authorization process - test;
|
- authorization process - test;
|
||||||
- access-token must be cached and included only in ALLOCATE and REFRESH;
|
- access-token must be cached and included only in ALLOCATE and REFRESH;
|
||||||
|
|||||||
@ -1463,12 +1463,27 @@ int add_integrity(app_ur_conn_info *clnet_info, stun_buffer *message)
|
|||||||
int check_integrity(app_ur_conn_info *clnet_info, stun_buffer *message)
|
int check_integrity(app_ur_conn_info *clnet_info, stun_buffer *message)
|
||||||
{
|
{
|
||||||
SHATYPE sht = clnet_info->shatype;
|
SHATYPE sht = clnet_info->shatype;
|
||||||
|
|
||||||
|
if(oauth && clnet_info->oauth) {
|
||||||
|
|
||||||
|
hmackey_t key;
|
||||||
|
st_password_t pwd;
|
||||||
|
|
||||||
|
ns_bcopy(otoken.enc_block.mac_key,key,otoken.enc_block.key_length);
|
||||||
|
|
||||||
|
return stun_check_message_integrity_by_key_str(get_turn_credentials_type(),
|
||||||
|
message->buf, (size_t)(message->len), key, pwd, sht, NULL);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if(stun_check_message_integrity_str(get_turn_credentials_type(),
|
if(stun_check_message_integrity_str(get_turn_credentials_type(),
|
||||||
message->buf, (size_t)(message->len), g_uname,
|
message->buf, (size_t)(message->len), g_uname,
|
||||||
clnet_info->realm, g_upwd, sht)<1) {
|
clnet_info->realm, g_upwd, sht)<1) {
|
||||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO,"Wrong integrity in a message received from server\n");
|
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO,"Wrong integrity in a message received from server\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user