~ubuntu-branches/ubuntu/vivid/trousers/vivid

« back to all changes in this revision

Viewing changes to src/tcs/tcs_pbg.c

  • Committer: Package Import Robot
  • Author(s): Pierre Chifflier
  • Date: 2012-11-10 17:04:44 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20121110170444-yvoa372npyp02mwr
Tags: 0.3.10-1
* Imported Upstream version 0.3.10
* Update symbols file
* Force build of tools

Show diffs side-by-side

added added

removed removed

Lines of Context:
717
717
                *data_len = offset2;
718
718
                break;
719
719
        }
720
 
        /* TPM BLOB: BLOB, optional DIGEST */
 
720
        /* TPM BLOB: TPM_PUBKEY, optional DIGEST */
721
721
        case TPM_ORD_CreateEndorsementKeyPair:
722
722
        case TPM_ORD_ReadPubek:
723
723
        {
731
731
                        return TCSERR(TSS_E_INTERNAL_ERROR);
732
732
                }
733
733
 
734
 
                if ((offset2 + TPM_DIGEST_SIZE) > TSS_TPM_TXBLOB_SIZE)
735
 
                        return TCSERR(TSS_E_INTERNAL_ERROR);
736
 
 
737
734
                if (digest1) {
738
735
                        offset1 = offset2 = len - TPM_DIGEST_SIZE;
739
736
                        memcpy(digest1, &b[offset2], TPM_DIGEST_SIZE);
740
 
                } else
 
737
 
 
738
                        if ((offset2 + TPM_DIGEST_SIZE) > TSS_TPM_TXBLOB_SIZE)
 
739
                                return TCSERR(TSS_E_INTERNAL_ERROR);
 
740
                } else {
741
741
                        offset2 = len;
742
742
 
 
743
                        if (offset2 > TSS_TPM_TXBLOB_SIZE)
 
744
                                return TCSERR(TSS_E_INTERNAL_ERROR);
 
745
                }
 
746
 
743
747
                offset1 = TSS_TPM_TXBLOB_HDR_LEN;
744
748
                offset2 -= offset1;
745
749
                if ((*data = malloc((size_t)offset2)) == NULL) {