The STDLL objects are exporting all their interface, including the
convenience functions that includes crypto and hash functions that
shouldn't be used by the host software using OpenCryptoki.

This is a tentative patch that hides all the functions not starting with
SC_ and ST_ so that they are not visible to host functions, and leaves them
visible only from the module itself.
---
 usr/lib/pkcs11/soft_stdll/Makefile.am |    3 ++-
 usr/lib/pkcs11/tpm_stdll/Makefile.am  |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/usr/lib/pkcs11/soft_stdll/Makefile.am 
b/usr/lib/pkcs11/soft_stdll/Makefile.am
index 7d3ed3d..3dc3a0e 100644
--- a/usr/lib/pkcs11/soft_stdll/Makefile.am
+++ b/usr/lib/pkcs11/soft_stdll/Makefile.am
@@ -1,7 +1,8 @@
 nobase_lib_LTLIBRARIES = opencryptoki/stdll/libpkcs11_sw.la
 
 opencryptoki_stdll_libpkcs11_sw_la_LDFLAGS = -shared -Wl,-Bsymbolic    \
-                                            -lc -lpthread -lcrypto
+                                            -lc -lpthread -lcrypto \
+                                            -export-symbols-regex '^S[CT]_'
 
 # Not all versions of automake observe libname_CFLAGS
 opencryptoki_stdll_libpkcs11_sw_la_CFLAGS = -DSPINXPL -DDEV -D_THREAD_SAFE  \
diff --git a/usr/lib/pkcs11/tpm_stdll/Makefile.am 
b/usr/lib/pkcs11/tpm_stdll/Makefile.am
index 02b231d..5b8d9d9 100644
--- a/usr/lib/pkcs11/tpm_stdll/Makefile.am
+++ b/usr/lib/pkcs11/tpm_stdll/Makefile.am
@@ -17,7 +17,8 @@ opencryptoki_stdll_libpkcs11_tpm_la_CFLAGS = -DLINUX 
-DSPINXPL -DNOCDMF       \
                                             -DSTDLL_NAME=\"tpmtok\"
 
 opencryptoki_stdll_libpkcs11_tpm_la_LDFLAGS = -shared -Wl,-Bsymbolic   \
-                                             -lcrypto -ltspi -lpthread
+                                             -lcrypto -ltspi -lpthread \
+                                            -export-symbols-regex '^S[CT]_'
 
 opencryptoki_stdll_libpkcs11_tpm_la_SOURCES = ../common/asn1.c           \
                                               dig_mgr.c                  \
-- 
1.7.4.rc2


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to