Add session ID as explicit parameter to SSL session cache API

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index 40ad490..784ab2d 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -2784,10 +2784,9 @@
         return;
 #endif
 
-    session_tmp.id_len = session->id_len;
-    memcpy( session_tmp.id, session->id, session->id_len );
-
     ret = ssl->conf->f_get_cache( ssl->conf->p_cache,
+                                  session->id,
+                                  session->id_len,
                                   &session_tmp );
     if( ret != 0 )
         goto exit;