Lines Matching refs:cbor

146     EicCbor cbor;  in eicPresentationGenerateSigningKeyPair()  local
147 eicCborInit(&cbor, cborBuf, sizeof cborBuf); in eicPresentationGenerateSigningKeyPair()
148 eicCborAppendArray(&cbor, 2); in eicPresentationGenerateSigningKeyPair()
149 eicCborAppendStringZ(&cbor, "ProofOfBinding"); in eicPresentationGenerateSigningKeyPair()
150 eicCborAppendByteString(&cbor, ctx->proofOfProvisioningSha256, EIC_SHA256_DIGEST_SIZE); in eicPresentationGenerateSigningKeyPair()
151 if (cbor.size > sizeof(cborBuf)) { in eicPresentationGenerateSigningKeyPair()
156 size_t proofOfBindingSize = cbor.size; in eicPresentationGenerateSigningKeyPair()
269 EicCbor cbor; in eicPresentationValidateRequestMessage() local
270 eicCborInit(&cbor, NULL, 0); in eicPresentationValidateRequestMessage()
271 eicCborAppendArray(&cbor, 4); in eicPresentationValidateRequestMessage()
272 eicCborAppendStringZ(&cbor, "Signature1"); in eicPresentationValidateRequestMessage()
278 eicCborAppendByteString(&cbor, coseEncodedProtectedHeaders, in eicPresentationValidateRequestMessage()
283 eicCborAppendByteString(&cbor, externalAad, sizeof(externalAad)); in eicPresentationValidateRequestMessage()
319 eicCborBegin(&cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, rabCalculatedSize); in eicPresentationValidateRequestMessage()
321 eicCborAppendSemantic(&cbor, EIC_CBOR_SEMANTIC_TAG_ENCODED_CBOR); in eicPresentationValidateRequestMessage()
324 eicCborBegin(&cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, calculatedSize); in eicPresentationValidateRequestMessage()
328 size_t payloadOffset = cbor.size; in eicPresentationValidateRequestMessage()
329 eicCborBegin(&cbor, EIC_CBOR_MAJOR_TYPE_ARRAY, 3); in eicPresentationValidateRequestMessage()
330 eicCborAppendStringZ(&cbor, "ReaderAuthentication"); in eicPresentationValidateRequestMessage()
331 eicCborAppend(&cbor, sessionTranscript, sessionTranscriptSize); in eicPresentationValidateRequestMessage()
332 eicCborAppendSemantic(&cbor, EIC_CBOR_SEMANTIC_TAG_ENCODED_CBOR); in eicPresentationValidateRequestMessage()
333 eicCborBegin(&cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, requestMessageSize); in eicPresentationValidateRequestMessage()
334 eicCborAppend(&cbor, requestMessage, requestMessageSize); in eicPresentationValidateRequestMessage()
336 if (cbor.size != payloadOffset + calculatedSize) { in eicPresentationValidateRequestMessage()
337 eicDebug("CBOR size is %zd but we expected %zd", cbor.size, payloadOffset + calculatedSize); in eicPresentationValidateRequestMessage()
341 eicCborFinal(&cbor, toBeSignedDigest); in eicPresentationValidateRequestMessage()
561 static size_t appendDeviceAuthentication(EicCbor* cbor, const uint8_t* sessionTranscript, in appendDeviceAuthentication() argument
601 eicCborBegin(cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, dabCalculatedSize); in appendDeviceAuthentication()
603 eicCborAppendSemantic(cbor, EIC_CBOR_SEMANTIC_TAG_ENCODED_CBOR); in appendDeviceAuthentication()
606 eicCborBegin(cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, calculatedSize); in appendDeviceAuthentication()
608 eicCborAppendArray(cbor, 4); in appendDeviceAuthentication()
609 eicCborAppendStringZ(cbor, "DeviceAuthentication"); in appendDeviceAuthentication()
610 eicCborAppend(cbor, sessionTranscript, sessionTranscriptSize); in appendDeviceAuthentication()
611 eicCborAppendString(cbor, docType, docTypeLength); in appendDeviceAuthentication()
616 eicCborAppendSemantic(cbor, EIC_CBOR_SEMANTIC_TAG_ENCODED_CBOR); in appendDeviceAuthentication()
617 eicCborBegin(cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, expectedDeviceNamespacesSize); in appendDeviceAuthentication()
618 size_t expectedCborSizeAtEnd = expectedDeviceNamespacesSize + cbor->size; in appendDeviceAuthentication()
675 EicCbor cbor; in eicPresentationPrepareDeviceAuthentication() local
676 eicCborInit(&cbor, NULL, 0); in eicPresentationPrepareDeviceAuthentication()
677 eicCborAppendSemantic(&cbor, EIC_CBOR_SEMANTIC_TAG_ENCODED_CBOR); in eicPresentationPrepareDeviceAuthentication()
678 eicCborAppendByteString(&cbor, sessionTranscript, sessionTranscriptSize); in eicPresentationPrepareDeviceAuthentication()
680 eicCborFinal(&cbor, salt); in eicPresentationPrepareDeviceAuthentication()
690 eicCborInitHmacSha256(&ctx->cbor, NULL, 0, derivedKey, sizeof(derivedKey)); in eicPresentationPrepareDeviceAuthentication()
702 eicCborAppendArray(&ctx->cbor, 4); in eicPresentationPrepareDeviceAuthentication()
703 eicCborAppendStringZ(&ctx->cbor, "MAC0"); in eicPresentationPrepareDeviceAuthentication()
709 eicCborAppendByteString(&ctx->cbor, coseEncodedProtectedHeaders, in eicPresentationPrepareDeviceAuthentication()
715 eicCborAppendByteString(&ctx->cbor, externalAad, sizeof(externalAad)); in eicPresentationPrepareDeviceAuthentication()
719 appendDeviceAuthentication(&ctx->cbor, sessionTranscript, sessionTranscriptSize, in eicPresentationPrepareDeviceAuthentication()
721 eicCborAppendMap(&ctx->cbor, numNamespacesWithValues); in eicPresentationPrepareDeviceAuthentication()
772 eicCborAppendString(&ctx->cbor, nameSpace, nameSpaceLength); in eicPresentationStartRetrieveEntryValue()
773 eicCborAppendMap(&ctx->cbor, newNamespaceNumEntries); in eicPresentationStartRetrieveEntryValue()
830 eicCborAppendString(&ctx->cbor, name, nameLength); in eicPresentationStartRetrieveEntryValue()
874 eicCborAppend(&ctx->cbor, content, encryptedContentSize - 28); in eicPresentationRetrieveEntryValue()
892 if (ctx->cbor.size != ctx->expectedCborSizeAtEnd) { in eicPresentationFinishRetrieval()
893 eicDebug("CBOR size is %zd, was expecting %zd", ctx->cbor.size, ctx->expectedCborSizeAtEnd); in eicPresentationFinishRetrieval()
896 eicCborFinal(&ctx->cbor, digestToBeMaced); in eicPresentationFinishRetrieval()
939 EicCbor cbor; in eicPresentationDeleteCredential() local
941 eicCborInit(&cbor, NULL, 0); in eicPresentationDeleteCredential()
954 eicCborAppendArray(&cbor, 4); in eicPresentationDeleteCredential()
955 eicCborAppendStringZ(&cbor, "Signature1"); in eicPresentationDeleteCredential()
961 eicCborAppendByteString(&cbor, coseEncodedProtectedHeaders, in eicPresentationDeleteCredential()
967 eicCborAppendByteString(&cbor, externalAad, sizeof(externalAad)); in eicPresentationDeleteCredential()
972 eicCborBegin(&cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, proofOfDeletionCborSize); in eicPresentationDeleteCredential()
975 eicCborAppendArray(&cbor, includeChallenge ? 4 : 3); in eicPresentationDeleteCredential()
976 eicCborAppendStringZ(&cbor, "ProofOfDeletion"); in eicPresentationDeleteCredential()
977 eicCborAppendString(&cbor, docType, docTypeLength); in eicPresentationDeleteCredential()
979 eicCborAppendByteString(&cbor, challenge, challengeSize); in eicPresentationDeleteCredential()
981 eicCborAppendBool(&cbor, ctx->testCredential); in eicPresentationDeleteCredential()
984 eicCborFinal(&cbor, cborSha256); in eicPresentationDeleteCredential()
998 EicCbor cbor; in eicPresentationProveOwnership() local
1000 eicCborInit(&cbor, NULL, 0); in eicPresentationProveOwnership()
1013 eicCborAppendArray(&cbor, 4); in eicPresentationProveOwnership()
1014 eicCborAppendStringZ(&cbor, "Signature1"); in eicPresentationProveOwnership()
1020 eicCborAppendByteString(&cbor, coseEncodedProtectedHeaders, in eicPresentationProveOwnership()
1026 eicCborAppendByteString(&cbor, externalAad, sizeof(externalAad)); in eicPresentationProveOwnership()
1031 eicCborBegin(&cbor, EIC_CBOR_MAJOR_TYPE_BYTE_STRING, proofOfOwnershipCborSize); in eicPresentationProveOwnership()
1034 eicCborAppendArray(&cbor, 4); in eicPresentationProveOwnership()
1035 eicCborAppendStringZ(&cbor, "ProofOfOwnership"); in eicPresentationProveOwnership()
1036 eicCborAppendString(&cbor, docType, docTypeLength); in eicPresentationProveOwnership()
1037 eicCborAppendByteString(&cbor, challenge, challengeSize); in eicPresentationProveOwnership()
1038 eicCborAppendBool(&cbor, testCredential); in eicPresentationProveOwnership()
1041 eicCborFinal(&cbor, cborSha256); in eicPresentationProveOwnership()