static apr_file_t *writetty = NULL;
static apr_file_t *readtty = NULL;
-
+
+/*
+ * sslc has a nasty flaw where its
+ * PEM_read_bio_PrivateKey does not take a callback arg.
+ */
+static server_rec *ssl_pphrase_server_rec = NULL;
+
int ssl_pphrase_Handle_CB(char *, int, int, void *);
static char *pphrase_array_get(apr_array_header_t *arr, int idx)
}
cpPassPhraseCur = NULL;
+ ssl_pphrase_server_rec = s; /* to make up for sslc flaw */
+
bReadable = ((pPrivateKey = SSL_read_PrivateKey(szPath, NULL,
ssl_pphrase_Handle_CB, s)) != NULL ? TRUE : FALSE);
-
+
/*
* when the private key file now was readable,
* it's fine and we go out of the loop
int ssl_pphrase_Handle_CB(char *buf, int bufsize, int verify, void *srv)
{
- SSLModConfigRec *mc = myModConfig((server_rec *)srv);
+ SSLModConfigRec *mc;
server_rec *s;
apr_pool_t *p;
apr_array_header_t *aPassPhrase;
char *cpp;
int len = -1;
+#ifndef OPENSSL_VERSION_NUMBER
+ /* make up for sslc flaw */
+ srv = ssl_pphrase_server_rec;
+#endif
+
+ mc = myModConfig((server_rec *)srv);
+
/*
* Reconnect to the context of ssl_phrase_Handle()
*/