summarylogtreecommitdiffstats
path: root/0004-Dont-read-PEM-keys.patch
blob: cdecf582c3874f378dbf2397a1a99f0de07797fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/libmariadb/libmariadb/secure/openssl.c
+++ b/libmariadb/libmariadb/secure/openssl.c
@@ -380,27 +380,10 @@
 
   if (keyfile && keyfile[0])
   {
-    FILE *fp;
-    if ((fp= fopen(keyfile, "rb")))
-    {
-      EVP_PKEY *key= EVP_PKEY_new();
-      PEM_read_PrivateKey(fp, &key, NULL, pw);
-      fclose(fp);
-      if (SSL_CTX_use_PrivateKey(ctx, key) != 1)
-      {
-        unsigned long err= ERR_peek_error();
-        EVP_PKEY_free(key);
-        if (!(ERR_GET_LIB(err) == ERR_LIB_X509 &&
-	            ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE))
-          goto error;
-      }
-      EVP_PKEY_free(key);
-    } else {
       my_set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, 
                    CER(CR_FILE_NOT_FOUND), keyfile);
       return 1;
     }
-  }
   /* verify key */
   if (certfile && SSL_CTX_check_private_key(ctx) != 1)
     goto error;