Lines Matching refs:max

63 inline int unpack3_BYTE(BYTE* ptr, UINT32* pos, UINT32 max, BYTE *t)  in unpack3_BYTE()  argument
65 if (*pos + 1 > max) in unpack3_BYTE()
93 inline int unpack3_UINT16(BYTE* ptr, UINT32* pos, UINT32 max, UINT16 *t) in unpack3_UINT16() argument
95 if (*pos + 2 > max) in unpack3_UINT16()
117 inline int unpack3_UINT32(BYTE* ptr, UINT32* pos, UINT32 max, UINT32 *t) in unpack3_UINT32() argument
119 if (*pos + 4 > max) in unpack3_UINT32()
261 inline int unpack3_BUFFER(BYTE* ptr, UINT32* pos, UINT32 max, BYTE* buf, UINT32 size) { in unpack3_BUFFER() argument
262 if (*pos + size > max) in unpack3_BUFFER()
298 inline int unpack3_PTR(BYTE* ptr, UINT32* pos, UINT32 max, BYTE** buf, UINT32 size, UnpackPtr alloc… in unpack3_PTR() argument
299 if (size > max || *pos + size > max) in unpack3_PTR()
309 #define unpack3_VPTR(ptr, pos, max, buf, size, alloc) unpack3_PTR(ptr, pos, max, (void*)(buf), size… argument
366 inline int unpack3_TPM_VERSION(BYTE* ptr, UINT32 *pos, UINT32 max, TPM_VERSION* t) { in unpack3_TPM_VERSION() argument
367 if (*pos + 4 > max) in unpack3_TPM_VERSION()
415 inline int unpack3_TPM_DIGEST(BYTE* ptr, UINT32* pos, UINT32 max, TPM_DIGEST* d) { in unpack3_TPM_DIGEST() argument
416 return unpack3_BUFFER(ptr, pos, max, d->digest, TPM_DIGEST_SIZE); in unpack3_TPM_DIGEST()
452 inline int unpack3_TPM_NONCE(BYTE* ptr, UINT32* pos, UINT32 max, TPM_NONCE* n) { in unpack3_TPM_NONCE() argument
453 return unpack3_BUFFER(ptr, pos, max, n->nonce, TPM_DIGEST_SIZE); in unpack3_TPM_NONCE()
473 inline int unpack3_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, UINT32* pos, UINT32 max, TPM_SYMMETRIC_KEY_PA… in unpack3_TPM_SYMMETRIC_KEY_PARMS() argument
474 return unpack3_UINT32(ptr, pos, max, &k->keyLength) || in unpack3_TPM_SYMMETRIC_KEY_PARMS()
475 unpack3_UINT32(ptr, pos, max, &k->blockSize) || in unpack3_TPM_SYMMETRIC_KEY_PARMS()
476 unpack3_UINT32(ptr, pos, max, &k->ivSize) || in unpack3_TPM_SYMMETRIC_KEY_PARMS()
477 unpack3_PTR(ptr, pos, max, &k->IV, k->ivSize, alloc); in unpack3_TPM_SYMMETRIC_KEY_PARMS()
486 inline int unpack3_TPM_SYMMETRIC_KEY(BYTE* ptr, UINT32* pos, UINT32 max, TPM_SYMMETRIC_KEY* k, Unpa… in unpack3_TPM_SYMMETRIC_KEY() argument
487 return unpack3_UINT32(ptr, pos, max, &k->algId) || in unpack3_TPM_SYMMETRIC_KEY()
488 unpack3_UINT16(ptr, pos, max, &k->encScheme) || in unpack3_TPM_SYMMETRIC_KEY()
489 unpack3_UINT16(ptr, pos, max, &k->size) || in unpack3_TPM_SYMMETRIC_KEY()
490 unpack3_PTR(ptr, pos, max, &k->data, k->size, alloc); in unpack3_TPM_SYMMETRIC_KEY()
502 inline int unpack3_TPM_RSA_KEY_PARMS(BYTE* ptr, UINT32* pos, UINT32 max, TPM_RSA_KEY_PARMS* k, Unpa… in unpack3_TPM_RSA_KEY_PARMS() argument
503 return unpack3_UINT32(ptr, pos, max, &k->keyLength) || in unpack3_TPM_RSA_KEY_PARMS()
504 unpack3_UINT32(ptr, pos, max, &k->numPrimes) || in unpack3_TPM_RSA_KEY_PARMS()
505 unpack3_UINT32(ptr, pos, max, &k->exponentSize) || in unpack3_TPM_RSA_KEY_PARMS()
506 unpack3_PTR(ptr, pos, max, &k->exponent, k->exponentSize, alloc); in unpack3_TPM_RSA_KEY_PARMS()
584 inline int unpack3_TPM_STORE_PUBKEY(BYTE* ptr, UINT32* pos, UINT32 max, TPM_STORE_PUBKEY* k, Unpack… in unpack3_TPM_STORE_PUBKEY() argument
585 return unpack3_UINT32(ptr, pos, max, &k->keyLength) || in unpack3_TPM_STORE_PUBKEY()
586 unpack3_PTR(ptr, pos, max, &k->key, k->keyLength, alloc); in unpack3_TPM_STORE_PUBKEY()
621 inline int unpack3_TPM_PCR_SELECTION(BYTE* ptr, UINT32* pos, UINT32 max, TPM_PCR_SELECTION* p, Unpa… in unpack3_TPM_PCR_SELECTION() argument
622 return unpack3_UINT16(ptr, pos, max, &p->sizeOfSelect) || in unpack3_TPM_PCR_SELECTION()
623 unpack3_PTR(ptr, pos, max, &p->pcrSelect, p->sizeOfSelect, alloc); in unpack3_TPM_PCR_SELECTION()
640 inline int unpack3_TPM_PCR_INFO(BYTE* ptr, UINT32* pos, UINT32 max, TPM_PCR_INFO* p, UnpackPtr allo… in unpack3_TPM_PCR_INFO() argument
641 return unpack3_TPM_PCR_SELECTION(ptr, pos, max, &p->pcrSelection, alloc) || in unpack3_TPM_PCR_INFO()
642 unpack3_TPM_COMPOSITE_HASH(ptr, pos, max, &p->digestAtRelease) || in unpack3_TPM_PCR_INFO()
643 unpack3_TPM_COMPOSITE_HASH(ptr, pos, max, &p->digestAtCreation); in unpack3_TPM_PCR_INFO()
681 inline int unpack3_TPM_PCR_INFO_LONG(BYTE* ptr, UINT32* pos, UINT32 max, TPM_PCR_INFO_LONG* p, Unpa… in unpack3_TPM_PCR_INFO_LONG() argument
682 return unpack3_TPM_STRUCTURE_TAG(ptr, pos, max, &p->tag) || in unpack3_TPM_PCR_INFO_LONG()
683 unpack3_TPM_LOCALITY_SELECTION(ptr, pos, max, in unpack3_TPM_PCR_INFO_LONG()
685 unpack3_TPM_LOCALITY_SELECTION(ptr, pos, max, in unpack3_TPM_PCR_INFO_LONG()
687 unpack3_TPM_PCR_SELECTION(ptr, pos, max, in unpack3_TPM_PCR_INFO_LONG()
689 unpack3_TPM_PCR_SELECTION(ptr, pos, max, in unpack3_TPM_PCR_INFO_LONG()
691 unpack3_TPM_COMPOSITE_HASH(ptr, pos, max, in unpack3_TPM_PCR_INFO_LONG()
693 unpack3_TPM_COMPOSITE_HASH(ptr, pos, max, &p->digestAtRelease); in unpack3_TPM_PCR_INFO_LONG()
705 inline int unpack3_TPM_PCR_COMPOSITE(BYTE* ptr, UINT32* pos, UINT32 max, TPM_PCR_COMPOSITE* p, Unpa… in unpack3_TPM_PCR_COMPOSITE() argument
706 return unpack3_TPM_PCR_SELECTION(ptr, pos, max, &p->select, alloc) || in unpack3_TPM_PCR_COMPOSITE()
707 unpack3_UINT32(ptr, pos, max, &p->valueSize) || in unpack3_TPM_PCR_COMPOSITE()
708 unpack3_PTR(ptr, pos, max, (BYTE**)&p->pcrValue, p->valueSize, alloc); in unpack3_TPM_PCR_COMPOSITE()
728 inline int unpack3_TPM_KEY(BYTE* ptr, UINT32* pos, UINT32 max, TPM_KEY* k, UnpackPtr alloc) { in unpack3_TPM_KEY() argument
729 int rc = unpack3_TPM_VERSION(ptr, pos, max, &k->ver) || in unpack3_TPM_KEY()
730 unpack3_TPM_KEY_USAGE(ptr, pos, max, &k->keyUsage) || in unpack3_TPM_KEY()
731 unpack3_TPM_KEY_FLAGS(ptr, pos, max, &k->keyFlags) || in unpack3_TPM_KEY()
732 unpack3_TPM_AUTH_DATA_USAGE(ptr, pos, max, &k->authDataUsage) || in unpack3_TPM_KEY()
733 unpack3_TPM_KEY_PARMS(ptr, pos, max, &k->algorithmParms, alloc) || in unpack3_TPM_KEY()
734 unpack3_UINT32(ptr, pos, max, &k->PCRInfoSize); in unpack3_TPM_KEY()
737 rc = unpack3_TPM_PCR_INFO(ptr, pos, max, &k->PCRInfo, alloc); in unpack3_TPM_KEY()
740 return unpack3_TPM_STORE_PUBKEY(ptr, pos, max, &k->pubKey, alloc) || in unpack3_TPM_KEY()
741 unpack3_UINT32(ptr, pos, max, &k->encDataSize) || in unpack3_TPM_KEY()
742 unpack3_PTR(ptr, pos, max, &k->encData, k->encDataSize, alloc); in unpack3_TPM_KEY()
915 inline int unpack3_TPM_RQU_HEADER(BYTE* ptr, UINT32* pos, UINT32 max, in unpack3_TPM_RQU_HEADER() argument
918 unpack3_UINT16(ptr, pos, max, tag) || in unpack3_TPM_RQU_HEADER()
919 unpack3_UINT32(ptr, pos, max, size) || in unpack3_TPM_RQU_HEADER()
920 unpack3_UINT32(ptr, pos, max, ord); in unpack3_TPM_RQU_HEADER()