| 547 | } |
| 548 | |
| 549 | void SendingMessage::parseAuthenticationKeyword(scenario *msg_scenario, struct MessageComponent *dst, char *keyword) |
| 550 | { |
| 551 | char my_auth_user[KEYWORD_SIZE + 1]; |
| 552 | char my_auth_pass[KEYWORD_SIZE + 1]; |
| 553 | char my_aka[KEYWORD_SIZE + 1]; |
| 554 | |
| 555 | dst->type = E_Message_Authentication; |
| 556 | |
| 557 | memset(my_auth_user,0,KEYWORD_SIZE); |
| 558 | memset(my_auth_pass,0,KEYWORD_SIZE); |
| 559 | /* Look for optional username and password parameters */ |
| 560 | getKeywordParam(keyword, "username=", my_auth_user); |
| 561 | getKeywordParam(keyword, "password=", my_auth_pass); |
| 562 | |
| 563 | if(*my_auth_user == '\0') { |
| 564 | strncpy(my_auth_user, auth_username ? auth_username : service, |
| 565 | sizeof(my_auth_user) - 1); |
| 566 | } |
| 567 | if(*my_auth_pass == '\0') { |
| 568 | strncpy(my_auth_pass, auth_password, sizeof(my_auth_pass) - 1); |
| 569 | } |
| 570 | |
| 571 | |
| 572 | dst->comp_param.auth_param.auth_user = new SendingMessage(msg_scenario, my_auth_user, true /* skip sanity */); |
| 573 | dst->comp_param.auth_param.auth_pass = new SendingMessage(msg_scenario, my_auth_pass, true); |
| 574 | |
| 575 | /* add aka_OP, aka_AMF, aka_K */ |
| 576 | getKeywordParam(keyword, "aka_K=", my_aka); |
| 577 | if (my_aka[0]==0) { |
| 578 | memcpy(my_aka,my_auth_pass,16); |
| 579 | my_aka[16]=0; |
| 580 | } |
| 581 | dst->comp_param.auth_param.aka_K = new SendingMessage(msg_scenario, my_aka, true); |
| 582 | |
| 583 | getKeywordParam(keyword, "aka_OP=", my_aka); |
| 584 | dst->comp_param.auth_param.aka_OP = new SendingMessage(msg_scenario, my_aka, true); |
| 585 | getKeywordParam(keyword, "aka_AMF=", my_aka); |
| 586 | dst->comp_param.auth_param.aka_AMF = new SendingMessage(msg_scenario, my_aka, true); |
| 587 | } |
| 588 | |
| 589 | void SendingMessage::freeMessageComponent(struct MessageComponent *comp) |
| 590 | { |
nothing calls this directly
no outgoing calls
no test coverage detected