Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
77918217
Commit
77918217
authored
Mar 09, 2012
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't forget to update the nonce counter.
parent
11201729
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
clientside/lib/tmcd/tpm.c
clientside/lib/tmcd/tpm.c
+9
-7
No files found.
clientside/lib/tmcd/tpm.c
View file @
77918217
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2009-201
0
University of Utah and the Flux Group.
* Copyright (c) 2009-201
2
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -148,14 +148,15 @@ tmcd_tpm_generate_nonce(unsigned char *nonce)
int
byte_count
=
0
;
bzero
(
nonce
,
TPM_NONCE_BYTES
);
/* Nonce must be 160 bits long, and we must be quite sure that we will
* never use the same one twice. We put three things into the nonce to
* make it unique:
* 1) Timestamp to the best accuracy we can get
/*
* Nonce must be 160 bits (20 bytes) long, and we must be quite sure that
* we will never use the same one twice. We put three things into the
* nonce to make it unique:
* 1) Timestamp to the best accuracy we can get (8 bytes)
* 2) The PID of the current process, to avoid someone asking two
* different tmcds for nonces at th
te same time
* different tmcds for nonces at th
e same time (2 bytes)
* 3) A local counter, in case someone can ask for nonces faster than our
* clock resolution
* clock resolution
(4 bytes)
*/
// timestamp
...
...
@@ -183,6 +184,7 @@ tmcd_tpm_generate_nonce(unsigned char *nonce)
}
bcopy
(
&
nonce_counter
,
nonce
+
byte_count
,
sizeof
(
nonce_counter
));
byte_count
+=
sizeof
(
nonce_counter
);
nonce_counter
++
;
// TODO: Maybe hash to avoid giving away info on state on boss?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment