nonce는 concat(session_nonce, message_nonce)에 의해 생성됩니다. 세션
nonce와 메시지 nonce는 다음 섹션에서 정의됩니다.
opad는 값이 지정된 반복되는 바이트로 구성된 64바이트의 외부 패딩입니다.
0x5C입니다.
ipad는 값이 지정된 반복되는 바이트로 구성된 64바이트의 내부 패딩입니다.
0x36입니다.
세션 nonce 및 메시지 nonce
재생 공격을 방지하려면 제공자는 nonce가 종료되어 있지 않은지 확인해야 합니다.
반복되지 않습니다. 두 제공업체 모두에서 시계 또는 카운터 동기화를 유지하고 있으므로
Seeker는 간단하지 않으며 Provider는 세션 nonce를 생성합니다.
(연결당) - 연결 중 모든 메시지와 공유됩니다.
탐색자는 메시지당 메시지 nonce를 생성하는데 이는 무작위로
생성됩니다 각 메시지의 MAC을 생성하기 위한 nonce는
세션 nonce와 메시지 nonce의 조합입니다.
concat(session_nonce, message_nonce)
기기 정보 이벤트 그룹에 세션 nonce를 추가합니다.
메시지 그룹 이름
값
기기 정보 이벤트
0x03
메시지 코드 이름
값
세션 nonce
0x0A
RFCOMM에서 세션 nonce가 생성되어 탐색자에게 전송되어야 합니다.
연결:
옥텟
데이터 유형
설명
값
0
uint8
기기 정보 이벤트
0x03
1
uint8
세션 nonce
0x0A
2~3명
uint16
추가 데이터 길이
0x0008
4~11명
세션 nonce
다름
MAC가 필요할 때 메시지를 보내기 위해 탐색자는 메시지 nonce를 보냅니다
MAC 주소도 있습니다.
옥텟
데이터 유형
설명
값
0
uint8
메시지 그룹
다름
1
uint8
메시지 코드
다름
2~3명
uint16
추가 데이터 길이(추가 데이터 길이 + 16)
다름
4 - n
추가 데이터
다름
n+1~n+8
메시지 nonce
다름
n+9~n+16
메시지 인증 코드
다름
MAC (메시지 인증 코드) 확인
공급자는 메시지 인증 코드가 포함된 메시지를 수신하면
생성하는 함수와 동일한 함수를 사용하여 이를 확인해야 합니다. 즉,
수신된 MAC은
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-13(UTC)"],[[["\u003cp\u003eMessage Authentication Codes (MACs) are used to verify that Fast Pair configuration messages originate from Google Mobile Services (GMSCore) and not other apps.\u003c/p\u003e\n"],["\u003cp\u003eMACs are generated using HMAC-SHA256, incorporating session and message nonces to prevent replay attacks.\u003c/p\u003e\n"],["\u003cp\u003eProviders initiate a session nonce upon RFCOMM connection and seekers generate a unique message nonce for each message.\u003c/p\u003e\n"],["\u003cp\u003eTo verify a message, providers compute the MAC using the received data and compare it with the received MAC, using stored account keys for verification.\u003c/p\u003e\n"],["\u003cp\u003eIf MAC verification fails, the provider sends a NAK message indicating an incorrect authentication code.\u003c/p\u003e\n"]]],["Message Authentication Code (MAC) ensures messages originate from GMSCore. The Seeker generates a MAC using HMAC-SHA256, derived from a key (K), nonce, and message data. The nonce combines a per-connection session nonce (Provider-generated) and a per-message nonce (Seeker-generated). The Seeker transmits the message nonce and MAC with each message. The Provider verifies the MAC using the same function and stored keys, acting on the message only if the MAC is correct. If not, a NAK is sent.\n"],null,[]]