[intel/tpm2-tools] 4b57ff: tests: move test scripts to seperate directory
by GitHub
Branch: refs/heads/master
Home: https://github.com/intel/tpm2-tools
Commit: 4b57fffb5787901ebc441ed9e06e519e07416f72
https://github.com/intel/tpm2-tools/commit/4b57fffb5787901ebc441ed9e06e51...
Author: William Roberts <william.c.roberts(a)intel.com>
Date: 2017-12-18 (Mon, 18 Dec 2017)
Changed paths:
A test/system/helpers.sh
M test/system/test.sh
R test/system/test_helpers.sh
R test/system/test_output_formats.sh
R test/system/test_tpm2_activecredential.sh
R test/system/test_tpm2_certify.sh
R test/system/test_tpm2_changeauth.sh
R test/system/test_tpm2_create.sh
R test/system/test_tpm2_createpolicy.sh
R test/system/test_tpm2_createprimary.sh
R test/system/test_tpm2_dictionarylockout.sh
R test/system/test_tpm2_encryptdecrypt.sh
R test/system/test_tpm2_evictcontrol.sh
R test/system/test_tpm2_flushcontext.sh
R test/system/test_tpm2_getcap.sh
R test/system/test_tpm2_getmanufec.sh
R test/system/test_tpm2_getpubak.sh
R test/system/test_tpm2_getpubek.sh
R test/system/test_tpm2_getrandom.sh
R test/system/test_tpm2_hash.sh
R test/system/test_tpm2_hmac.sh
R test/system/test_tpm2_import.sh
R test/system/test_tpm2_listpersistent.sh
R test/system/test_tpm2_load.sh
R test/system/test_tpm2_loadexternal.sh
R test/system/test_tpm2_makecredential.sh
R test/system/test_tpm2_nv.sh
R test/system/test_tpm2_pcrevent.sh
R test/system/test_tpm2_pcrextend.sh
R test/system/test_tpm2_pcrlist.sh
R test/system/test_tpm2_quote.sh
R test/system/test_tpm2_rc_decode.sh
R test/system/test_tpm2_readpublic.sh
R test/system/test_tpm2_rsadecrypt.sh
R test/system/test_tpm2_rsaencrypt.sh
R test/system/test_tpm2_send.sh
R test/system/test_tpm2_sign.sh
R test/system/test_tpm2_startup.sh
R test/system/test_tpm2_unseal.sh
R test/system/test_tpm2_verifysignature.sh
A test/system/tests/activecredential.sh
A test/system/tests/certify.sh
A test/system/tests/changeauth.sh
A test/system/tests/create.sh
A test/system/tests/createpolicy.sh
A test/system/tests/createprimary.sh
A test/system/tests/dictionarylockout.sh
A test/system/tests/disabled/import.sh
A test/system/tests/encryptdecrypt.sh
A test/system/tests/evictcontrol.sh
A test/system/tests/flushcontext.sh
A test/system/tests/getcap.sh
A test/system/tests/getmanufec.sh
A test/system/tests/getpubak.sh
A test/system/tests/getpubek.sh
A test/system/tests/getrandom.sh
A test/system/tests/hash.sh
A test/system/tests/hmac.sh
A test/system/tests/listpersistent.sh
A test/system/tests/load.sh
A test/system/tests/loadexternal.sh
A test/system/tests/makecredential.sh
A test/system/tests/nv.sh
A test/system/tests/output_formats.sh
A test/system/tests/pcrevent.sh
A test/system/tests/pcrextend.sh
A test/system/tests/pcrlist.sh
A test/system/tests/quote.sh
A test/system/tests/rc_decode.sh
A test/system/tests/readpublic.sh
A test/system/tests/rsadecrypt.sh
A test/system/tests/rsaencrypt.sh
A test/system/tests/send.sh
A test/system/tests/sign.sh
A test/system/tests/startup.sh
A test/system/tests/unseal.sh
A test/system/tests/verifysignature.sh
Log Message:
-----------
tests: move test scripts to seperate directory
Organize the test scripts into a supordinate directory.
This makes finding tests easier as it doesn't really rely on
magic name prefixes.
Signed-off-by: William Roberts <william.c.roberts(a)intel.com>
Commit: cc51f9fe188a7894c541d533ab53947737c06bed
https://github.com/intel/tpm2-tools/commit/cc51f9fe188a7894c541d533ab5394...
Author: William Roberts <william.c.roberts(a)intel.com>
Date: 2017-12-18 (Mon, 18 Dec 2017)
Changed paths:
M tools/tpm2_getmanufec.c
Log Message:
-----------
tpm2_getmanufec: fix a memory leak
free() the malloc'd b64 decoded buffer.
Signed-off-by: William Roberts <william.c.roberts(a)intel.com>
Compare: https://github.com/intel/tpm2-tools/compare/955c1689c1ef...cc51f9fe188a
3 years, 2 months
[intel/tpm2-tools] 5437ab: test: test_tpm2_nv.sh large_file_name and large_fi...
by GitHub
Branch: refs/heads/3.X
Home: https://github.com/intel/tpm2-tools
Commit: 5437abdd960acf87464f23f2435bb506b1f872ca
https://github.com/intel/tpm2-tools/commit/5437abdd960acf87464f23f2435bb5...
Author: Jerry Snitselaar <jsnitsel(a)redhat.com>
Date: 2017-12-15 (Fri, 15 Dec 2017)
Changed paths:
M test/system/test_tpm2_nv.sh
Log Message:
-----------
test: test_tpm2_nv.sh large_file_name and large_file_read_name should be different
Currently both are set as nv.test_large_w, so the cmp -s after the redirect tests
will be comparing nv.test_large_w to itself. Change large_file_read_name to
nv.test_large_r.
Signed-off-by: Jerry Snitselaar <jsnitsel(a)redhat.com>
Signed-off-by: William Roberts <william.c.roberts(a)intel.com>
Commit: fb0edff055301769d0bdc3616d5feba7e9c277d4
https://github.com/intel/tpm2-tools/commit/fb0edff055301769d0bdc3616d5feb...
Author: William Roberts <william.c.roberts(a)intel.com>
Date: 2017-12-15 (Fri, 15 Dec 2017)
Changed paths:
M test/system/test_tpm2_nv.sh
Log Message:
-----------
test_tpm2_nv.sh: whitespace fix
Signed-off-by: William Roberts <william.c.roberts(a)intel.com>
Commit: ab1a2d468c4b2ac09a0ac651563653f36a73215f
https://github.com/intel/tpm2-tools/commit/ab1a2d468c4b2ac09a0ac651563653...
Author: William Roberts <william.c.roberts(a)intel.com>
Date: 2017-12-15 (Fri, 15 Dec 2017)
Changed paths:
M tools/tpm2_nvwrite.c
Log Message:
-----------
tpm2_nvwrite: fix buffer overflow
As reported by clang asan:
=================================================================
==435==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe036c0902 at pc 0x0000004a326d bp 0x7ffe036c02f0 sp 0x7ffe036bfaa0
WRITE of size 2048 at 0x7ffe036c0902 thread T0
#0 0x4a326c in __asan_memcpy (/home/wcrobert/workspace/tpm2-tools/tools/tpm2_nvwrite+0x4a326c)
#1 0x4e887b in nv_write /home/wcrobert/workspace/tpm2-tools/tools/tpm2_nvwrite.c:129:9
#2 0x4e82c4 in tpm2_tool_onrun /home/wcrobert/workspace/tpm2-tools/tools/tpm2_nvwrite.c:316:11
#3 0x4e90d9 in main /home/wcrobert/workspace/tpm2-tools/tools/tpm2_tool.c:150:11
#4 0x7fdfc968d82f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291
#5 0x4195c8 in _start (/home/wcrobert/workspace/tpm2-tools/tools/tpm2_nvwrite+0x4195c8)
Address 0x7ffe036c0902 is located in stack of thread T0 at offset 1538 in frame
#0 0x4e846f in nv_write /home/wcrobert/workspace/tpm2-tools/tools/tpm2_nvwrite.c:76
This frame has 8 object(s):
[32, 172) 'session_data_out'
[240, 256) 'sessions_data'
[272, 288) 'sessions_data_out'
[304, 312) 'session_data_array'
[336, 344) 'session_data_out_array'
[368, 452) 'nv_public'
[496, 500) 'max_data_size'
[512, 1538) 'nv_write_data' <== Memory access at offset 1538 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/home/wcrobert/workspace/tpm2-tools/tools/tpm2_nvwrite+0x4a326c) in __asan_memcpy
Shadow bytes around the buggy address:
0x1000406d00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000406d00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000406d00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000406d0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000406d0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1000406d0120:[02]f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3
0x1000406d0130: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
0x1000406d0140: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
0x1000406d0150: 00 00 00 00 00 00 00 00 02 f2 f2 f2 f2 f2 00 f3
0x1000406d0160: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
0x1000406d0170: 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 01 f2 00 f3
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==435==ABORTING
Fix by using the max buffer's size field, not the loaded from
file buffers size field.
Signed-off-by: William Roberts <william.c.roberts(a)intel.com>
Compare: https://github.com/intel/tpm2-tools/compare/b713ec836104...ab1a2d468c4b
3 years, 2 months
test_tpm2_nv.sh
by Jerry Snitselaar
Hi William,
With fixing the redirection for the tpm2_nvwrite portion of the large file test,
I see a buffer overflow with tpm2_nvwrite. I don't know if you are seeing that
there. This is with 3.0.1 using the PTT device. Prior to that and the fix for
the filename I was seeing an error with the tpm2_nvread portion that is most
likely the following issue: https://github.com/intel/tpm2-tss/issues/667
I'll add an issue on github to track it.
3 years, 2 months