Fix TURN long-term auth for Permissions Requests

Bug 904598 - Fix TURN long-term auth for Permissions Requests. r=abr
This commit is contained in:
EKR 2013-08-13 14:06:56 -07:00
Родитель d7bebca3d1
Коммит 6bc23abead
3 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -315,6 +315,10 @@ TEST_F(TurnClient, SendToSelf) {
Allocate();
SendTo(relay_addr_);
ASSERT_TRUE_WAIT(received() == 100, 1000);
PR_Sleep(10000); // Wait 10 seconds to make sure the
// CreatePermission has time to complete/fail.
SendTo(relay_addr_);
ASSERT_TRUE_WAIT(received() == 200, 1000);
}
TEST_F(TurnClient, AllocateDummyServer) {

Просмотреть файл

@ -89,7 +89,7 @@ nr_stun_receive_message(nr_stun_message *req, nr_stun_message *msg)
}
if (NR_STUN_GET_TYPE_METHOD(req->header.type) != NR_STUN_GET_TYPE_METHOD(msg->header.type)) {
r_log(NR_LOG_STUN,LOG_NOTICE,"Inconsistent message method: %03x", msg->header.type);
r_log(NR_LOG_STUN,LOG_NOTICE,"Inconsistent message method: %03x expected %03x", msg->header.type, req->header.type);
ABORT(R_REJECTED);
}

Просмотреть файл

@ -176,6 +176,11 @@ static int nr_turn_stun_set_auth_params(nr_turn_stun_ctx *ctx,
if (!ctx->nonce)
ABORT(R_NO_MEMORY);
RFREE(ctx->stun->realm);
ctx->stun->realm = r_strdup(ctx->realm);
if (!ctx->stun->realm)
ABORT(R_NO_MEMORY);
ctx->stun->auth_params.realm = ctx->realm;
ctx->stun->auth_params.nonce = ctx->nonce;
ctx->stun->auth_params.authenticate = 1; /* May already be 1 */