Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: tpm/tpm_delegation.c

Issue 660204: Upgrade to tpm-emulator version 0.7. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tpm/tpm_data.c ('k') | tpm/tpm_deprecated.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Software-Based Trusted Platform Module (TPM) Emulator for Linux 1 /* Software-based Trusted Platform Module (TPM) Emulator
2 * Copyright (C) 2006 Mario Strasser <mast@gmx.net>, 2 * Copyright (C) 2004-2010 Mario Strasser <mast@gmx.net>
3 * Domenic Schröder <schroeder@gmx.ch>,
4 * Swiss Federal Institute of Technology (ETH) Zurich
5 * 3 *
6 * This module is free software; you can redistribute it and/or modify 4 * This module is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published 5 * it under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; either version 2 of the License, 6 * by the Free Software Foundation; either version 2 of the License,
9 * or (at your option) any later version. 7 * or (at your option) any later version.
10 * 8 *
11 * This module is distributed in the hope that it will be useful, 9 * This module is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 12 * GNU General Public License for more details.
15 * 13 *
16 * $Id$ 14 * $Id: tpm_delegation.c 367 2010-02-13 15:52:18Z mast $
17 */ 15 */
18 16
19 #include "tpm_emulator.h" 17 #include "tpm_emulator.h"
20 #include "tpm_commands.h" 18 #include "tpm_commands.h"
21 #include "tpm_marshalling.h" 19 #include "tpm_marshalling.h"
22 #include "tpm_data.h" 20 #include "tpm_data.h"
23 #include "tpm_handles.h" 21 #include "tpm_handles.h"
24 #include "crypto/hmac.h" 22 #include "crypto/hmac.h"
25 #include "crypto/rc4.h" 23 #include "crypto/rc4.h"
26 24
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 tpm_free(*familyTable); 546 tpm_free(*familyTable);
549 tpm_free(*delegateTable); 547 tpm_free(*delegateTable);
550 return TPM_FAIL; 548 return TPM_FAIL;
551 } 549 }
552 } 550 }
553 } 551 }
554 } 552 }
555 return TPM_SUCCESS; 553 return TPM_SUCCESS;
556 } 554 }
557 555
558 static TPM_TAG get_structure_tag(BYTE *ptr, UINT32 length)
559 {
560 TPM_TAG tag;
561 if (tpm_unmarshal_TPM_TAG(&ptr, &length, &tag) != 0) return 0xffff;
562 return tag;
563 }
564
565 TPM_RESULT TPM_Delegate_UpdateVerification(UINT32 inputSize, BYTE *inputData, 556 TPM_RESULT TPM_Delegate_UpdateVerification(UINT32 inputSize, BYTE *inputData,
566 TPM_AUTH *auth1, UINT32 *outputSize, 557 TPM_AUTH *auth1, UINT32 *outputSize,
567 BYTE **outputData) 558 BYTE **outputData)
568 { 559 {
569 TPM_RESULT res; 560 TPM_RESULT res;
570 TPM_SESSION_DATA *session; 561 TPM_SESSION_DATA *session;
571 info("TPM_Delegate_UpdateVerification()"); 562 info("TPM_Delegate_UpdateVerification()");
572 /* verify authorization */ 563 /* verify authorization */
573 session = tpm_get_auth(auth1->authHandle); 564 session = tpm_get_auth(auth1->authHandle);
574 if (session == NULL) return TPM_AUTHFAIL; 565 if (session == NULL) return TPM_AUTHFAIL;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 } 746 }
756 tpm_free(sens_buf); 747 tpm_free(sens_buf);
757 if (sensitive.tag != TPM_TAG_DELEGATE_SENSITIVE) return TPM_BAD_PARAMETER; 748 if (sensitive.tag != TPM_TAG_DELEGATE_SENSITIVE) return TPM_BAD_PARAMETER;
758 } else { 749 } else {
759 debug("unsupported input structure: %02x%02x", delegation[0], delegation[1]) ; 750 debug("unsupported input structure: %02x%02x", delegation[0], delegation[1]) ;
760 return TPM_BAD_PARAMETER; 751 return TPM_BAD_PARAMETER;
761 } 752 }
762 return TPM_SUCCESS; 753 return TPM_SUCCESS;
763 } 754 }
764 755
OLDNEW
« no previous file with comments | « tpm/tpm_data.c ('k') | tpm/tpm_deprecated.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698