TDDL function open_device() fails if fd == 0.
FD 0 is a valid file descriptor number and occurs frequently with daemons (where stdin 0 is closed).
As a result, the function returns a failure when it really succeeded (a false failure).
The following Oracle Solaris patch fixes the problem and is suitable for all operating systems and compilers.
--- src/tddl/tddl.c 2014-04-24 11:05:44.000000000 -0700
+++ src/tddl/tddl.c 2016-06-20 11:45:31.929095585 -0700
@@ -18,13 +18,17 @@
#include "trousers/tss.h"
#include "trousers_types.h"
+#ifndef SOLARIS
#include "linux/tpm.h"
+#endif
#include "tcslog.h"
#include "tddl.h"
struct tpm_device_node tpm_device_nodes[] = {
+#ifndef SOLARIS
{"/dev/tpm0", TDDL_UNDEF, TDDL_UNDEF},
{"/udev/tpm0", TDDL_UNDEF, TDDL_UNDEF},
+#endif
{"/dev/tpm", TDDL_UNDEF, TDDL_UNDEF},
{NULL, 0, 0}
};
@@ -63,7 +79,7 @@
fd = socket(AF_INET, SOCK_STREAM, 0);
Originally fixed with Oracle Solaris bug 15722951 (Sun Microsystems bug 7056071) enable tcsd failed in Solaris 11.
A bit off topic ... Dan Anderson: IBM has a TSS for TPM 2.0. If you would like to test it on Solaris, I'd be happy to fix any bugs you find. kgoldman@us.ibm.com