Use CERT_PKEY pointer instead of index

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2623)
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index ac2e858..8537e80 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -3149,9 +3149,9 @@
              */
             if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
                 return 2;
-            if (s->s3->tmp.cert_idx == -1)
+            if (s->s3->tmp.cert == NULL)
                 return 0;
-            s->cert->key = &s->cert->pkeys[s->s3->tmp.cert_idx];
+            s->cert->key = s->s3->tmp.cert;
             return 1;
         }
         return ssl_cert_set_current(s->cert, larg);