Lines Matching refs:token
54 bool auth_token_timed_out(const hw_auth_token_t& token, uint32_t timeout) const { in auth_token_timed_out() argument
55 return current_time_ > ntoh(token.timestamp) + timeout; in auth_token_timed_out()
520 hw_auth_token_t token; in TEST_F() local
521 memset(&token, 0, sizeof(token)); in TEST_F()
522 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
523 token.challenge = 99; in TEST_F()
524 token.user_id = 9; in TEST_F()
525 token.authenticator_id = 0; in TEST_F()
526 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
527 token.timestamp = 0; in TEST_F()
530 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
535 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
538 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
543 hw_auth_token_t token; in TEST_F() local
544 memset(&token, 0, sizeof(token)); in TEST_F()
545 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
546 token.challenge = 99; in TEST_F()
547 token.user_id = 9; in TEST_F()
548 token.authenticator_id = 0; in TEST_F()
549 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
550 token.timestamp = 0; in TEST_F()
554 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
559 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
563 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
568 token.challenge, false /* is_begin_operation */)); in TEST_F()
572 hw_auth_token_t token; in TEST_F() local
573 memset(&token, 0, sizeof(token)); in TEST_F()
574 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
575 token.challenge = 99; in TEST_F()
576 token.user_id = 9; in TEST_F()
577 token.authenticator_id = 0; in TEST_F()
578 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
579 token.timestamp = 0; in TEST_F()
582 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
587 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
591 token.challenge + 1 /* doesn't match token */, in TEST_F()
596 hw_auth_token_t token; in TEST_F() local
597 memset(&token, 0, sizeof(token)); in TEST_F()
598 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
599 token.challenge = 99; in TEST_F()
600 token.user_id = 9; in TEST_F()
601 token.authenticator_id = 0; in TEST_F()
602 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
603 token.timestamp = 0; in TEST_F()
607 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
611 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
614 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
619 token.challenge, false /* is_begin_operation */)); in TEST_F()
623 hw_auth_token_t token; in TEST_F() local
624 memset(&token, 0, sizeof(token)); in TEST_F()
625 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
626 token.challenge = 99; in TEST_F()
627 token.user_id = 9; in TEST_F()
628 token.authenticator_id = 0; in TEST_F()
629 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
630 token.timestamp = 0; in TEST_F()
635 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
640 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
643 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
648 token.challenge, false /* is_begin_operation */)); in TEST_F()
652 hw_auth_token_t token; in TEST_F() local
653 memset(&token, 0, sizeof(token)); in TEST_F()
654 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
655 token.challenge = 99; in TEST_F()
656 token.user_id = 9; in TEST_F()
657 token.authenticator_id = 0; in TEST_F()
658 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
659 token.timestamp = 0; in TEST_F()
664 .Authorization(TAG_USER_SECURE_ID, token.user_id + 1 /* doesn't match token */) in TEST_F()
669 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
672 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
677 token.challenge, false /* is_begin_operation */)); in TEST_F()
681 hw_auth_token_t token; in TEST_F() local
682 memset(&token, 0, sizeof(token)); in TEST_F()
683 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
684 token.challenge = 99; in TEST_F()
685 token.user_id = 9; in TEST_F()
686 token.authenticator_id = 10; in TEST_F()
687 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
688 token.timestamp = 0; in TEST_F()
691 .Authorization(TAG_USER_SECURE_ID, token.authenticator_id) in TEST_F()
696 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
699 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
704 hw_auth_token_t token; in TEST_F() local
705 memset(&token, 0, sizeof(token)); in TEST_F()
706 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
707 token.challenge = 99; in TEST_F()
708 token.user_id = 9; in TEST_F()
709 token.authenticator_id = 0; in TEST_F()
710 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
711 token.timestamp = 0; in TEST_F()
715 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
723 token.challenge, true /* is_begin_operation */)); in TEST_F()
726 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
731 token.challenge, false /* is_begin_operation */)); in TEST_F()
735 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
742 token.challenge, false /* is_begin_operation */)); in TEST_F()
756 hw_auth_token_t token; in TEST_F() local
757 memset(&token, 0, sizeof(token)); in TEST_F()
758 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
759 token.challenge = 99; in TEST_F()
760 token.user_id = 9; in TEST_F()
761 token.authenticator_id = 0; in TEST_F()
762 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
763 token.timestamp = hton(kmen.current_time()); in TEST_F()
767 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
773 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
781 hw_auth_token_t token; in TEST_F() local
782 memset(&token, 0, sizeof(token)); in TEST_F()
783 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
784 token.challenge = 99; in TEST_F()
785 token.user_id = 9; in TEST_F()
786 token.authenticator_id = 0; in TEST_F()
787 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
788 token.timestamp = hton(static_cast<uint64_t>(kmen.current_time())); in TEST_F()
792 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
798 op_params.push_back(Authorization(TAG_AUTH_TOKEN, &token, sizeof(token))); in TEST_F()
830 hw_auth_token_t token; in TEST_F() local
831 memset(&token, 0, sizeof(token)); in TEST_F()
832 token.version = HW_AUTH_TOKEN_VERSION; in TEST_F()
833 token.challenge = 99; in TEST_F()
834 token.user_id = 9; in TEST_F()
835 token.authenticator_id = 0; in TEST_F()
836 token.authenticator_type = hton(static_cast<uint32_t>(HW_AUTH_PASSWORD)); in TEST_F()
837 token.timestamp = hton(static_cast<uint64_t>(kmen.current_time())); in TEST_F()
841 .Authorization(TAG_USER_SECURE_ID, token.user_id) in TEST_F()
850 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
855 kmen.AuthorizeOperation(KM_PURPOSE_SIGN, key_id, auth_set, op_params, token.challenge, in TEST_F()
860 token.challenge, true /* is_begin_operation */)); in TEST_F()