tpmclient: remove unneeded InitNullSession

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
diff --git a/Makefile-test.am b/Makefile-test.am
index 3c35c29..5d02716 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -259,7 +259,7 @@
 test_tpmclient_tpmclient_int_CFLAGS   = $(AM_CFLAGS) -U_FORTIFY_SOURCE  $(TESTS_CFLAGS)
 test_tpmclient_tpmclient_int_LDADD    = $(TESTS_LDADD)
 test_tpmclient_tpmclient_int_SOURCES  = \
-    test/tpmclient/CreateNullSession.c test/tpmclient/DecryptEncrypt.c \
+    test/tpmclient/DecryptEncrypt.c \
     test/tpmclient/Entity.c test/tpmclient/kdfa.c \
     test/tpmclient/LoadExternalHMACKey.c test/integration/main.c \
     test/tpmclient/sample.h test/tpmclient/TpmHmac.c \
diff --git a/test/tpmclient/CreateNullSession.c b/test/tpmclient/CreateNullSession.c
deleted file mode 100644
index 6c76ba2..0000000
--- a/test/tpmclient/CreateNullSession.c
+++ /dev/null
@@ -1,53 +0,0 @@
-//**********************************************************************;
-// Copyright (c) 2015, Intel Corporation
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-// THE POSSIBILITY OF SUCH DAMAGE.
-//**********************************************************************;
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "tss2_tpm2_types.h"
-
-TPM2B_NONCE nullSessionNonce;
-TPM2B_AUTH nullSessionHmac;
-
-void InitNullSession( TPMS_AUTH_COMMAND *nullSessionData )
-{
-    if( nullSessionData )
-    {
-
-        nullSessionData->sessionHandle = TPM2_RS_PW;
-
-        // Init nonce.
-        nullSessionData->nonce.size = 0;
-
-        // init hmac
-        nullSessionData->hmac.size = 0;
-
-        // Init session attributes
-        *( (UINT8 *)((void *)&( nullSessionData->sessionAttributes ) ) ) = 0;
-    }
-}
-
diff --git a/test/tpmclient/sample.h b/test/tpmclient/sample.h
index 391cb5a..f2ec8e5 100644
--- a/test/tpmclient/sample.h
+++ b/test/tpmclient/sample.h
@@ -32,7 +32,6 @@
 extern "C" {
 #endif
 
-
 #include "tss2_tpm2_types.h"
 #include "tpmclient.h"
 #include <stdio.h>
@@ -209,8 +208,6 @@
 TSS2_RC TpmCalcPHash( TSS2_SYS_CONTEXT *sysContext, TPM2_HANDLE handle1,
     TPM2_HANDLE handle2, TPMI_ALG_HASH authHash, TSS2_RC responseCode, TPM2B_DIGEST *pHash );
 
-void InitNullSession( TPMS_AUTH_COMMAND *nullSessionData );
-
 TSS2_RC LoadExternalHMACKey( TPMI_ALG_HASH hashAlg, TPM2B *key, TPM2_HANDLE *keyHandle, TPM2B_NAME *keyName );
 
 TSS2_RC EncryptCommandParam( SESSION *session, TPM2B_MAX_BUFFER *encryptedData, TPM2B_MAX_BUFFER *clearData, TPM2B_AUTH *authValue );
diff --git a/test/tpmclient/tpmclient.int.c b/test/tpmclient/tpmclient.int.c
index 90e2de4..3e1abab 100644
--- a/test/tpmclient/tpmclient.int.c
+++ b/test/tpmclient/tpmclient.int.c
@@ -3131,6 +3131,7 @@
         return 1;
     }
 
+    nullSessionsData.auths[0].sessionHandle = TPM2_RS_PW;
     nullSessionsDataOut.count = 1;
     nullSessionsDataOut.auths[0].nonce = nullSessionNonceOut;
     nullSessionsDataOut.auths[0].hmac = nullSessionHmac;
@@ -3146,8 +3147,6 @@
 
     InitEntities();
 
-    InitNullSession( &nullSessionsData.auths[0]);
-
     SysFinalizeTests();
 
     GetContextSizeTests();