Changeset 1877 for pjproject/trunk/pjnath/src/pjnath-test/stun.c
- Timestamp:
- Mar 19, 2008 11:00:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath-test/stun.c
r1869 r1877 270 270 271 271 /* Try to encode message */ 272 pj_stun_create_key(pool, &key, NULL, &USERNAME, &PASSWORD);272 pj_stun_create_key(pool, &key, NULL, &USERNAME, PJ_STUN_PASSWD_PLAIN, &PASSWORD); 273 273 status = pj_stun_msg_encode(msg, buf, sizeof(buf), 0, &key, &len); 274 274 if (status != PJ_SUCCESS) { … … 406 406 { 407 407 /* Decode all attribute types */ 408 return 0;409 }410 411 static int auth_test(void)412 {413 /* REALM and USERNAME is present, but MESSAGE-INTEGRITY is not present.414 * For short term, must with reply 401 without REALM.415 * For long term, must reply with 401 with REALM.416 */417 418 /* USERNAME is not present, server must respond with 432 (Missing419 * Username).420 */421 422 /* If long term credential is wanted and REALM is not present, server423 * must respond with 434 (Missing Realm)424 */425 426 /* If REALM doesn't match, server must respond with 434 (Missing Realm)427 * too, containing REALM and NONCE attribute.428 */429 430 /* When long term authentication is wanted and NONCE is NOT present,431 * server must respond with 435 (Missing Nonce), containing REALM and432 * NONCE attribute.433 */434 435 /* Simulate 438 (Stale Nonce) */436 437 /* Simulate 436 (Unknown Username) */438 439 /* When server wants to use short term credential, but request has440 * REALM, reject with .... ???441 */442 443 /* Invalid HMAC */444 445 /* Valid static short term, without NONCE */446 447 /* Valid static short term, WITH NONCE */448 449 /* Valid static long term (with NONCE */450 451 /* Valid dynamic short term (without NONCE) */452 453 /* Valid dynamic short term (with NONCE) */454 455 /* Valid dynamic long term (with NONCE) */456 457 408 return 0; 458 409 } … … 615 566 616 567 pj_stun_create_key(pool, &key, NULL, pj_cstr(&s1, v->username), 617 pj_cstr(&s2, v->password));568 PJ_STUN_PASSWD_PLAIN, pj_cstr(&s2, v->password)); 618 569 pj_stun_msg_encode(msg, buf, sizeof(buf), 0, &key, &len); 619 570 … … 752 703 goto on_return; 753 704 754 rc = auth_test();755 if (rc != 0)756 goto on_return;757 758 705 rc = fingerprint_test_vector(); 759 706 if (rc != 0)
Note: See TracChangeset
for help on using the changeset viewer.