Transmit string
am 15.06.2004 10:34:23 von apache_devDear Ralf S. Engelschall and other developers, I have problem.
Help me solve a problem, very need.
It is necessary read a line of the text (additional information on the us=
er) in the module mod_ssl
and to transfer it in the module openssl.
Reading of a line to make in the mod_ssl: file: ssl_engine_pphrase.c; fun=
ction: ssl_pphrase_Handle
and to transfer in the openssl: file: s3_srvr.c; function: ssl3_accept.
Apache 2.0.49 - Openssl0.9.6m
I make approximately as below:
//------mod_ssl.h------//
typedef struct {
pid_t pid;
apr_pool_t *pPool;
......
char *szinf; //!!! <- Add
......
struct {
void *pV1, *pV2, *pV3, *pV4, *pV5, *pV6, *pV7, *pV8, *pV9, *pV10;
} rCtx;
} SSLModConfigRec;
//-----ssl_engine_pphrase.c----//
void ssl_pphrase_Handle(server_rec *s, apr_pool_t *p)
{
......
mc->szinf =3D apr_palloc(p,sizeof(char *) * 100);
char *buf =3D apr_palloc(p, sizeof(char *) * 100);
apr_file_open_stdout(&writetty, p);
i =3D EVP_read_pw_string(buf, bufsize, "", FALSE);
apr_cpystrn(mc->szinf,buf,strlen(buf)+1);
//mc->inf - contain reading string
......
}
//-----ssl_engine_init.c----//
static int ssl_server_import_key(server_rec *s, modssl_ctx_t *mctx, const=
char *id, int idx)
{
......
apr_cpystrn(mctx->ssl_ctx->infO, mc->szinf,strlen(mc->szinf)+1); // <- co=
py string to struct ssl_ctx
......
}
//-----ssl.h-----//
struct ssl_ctx_st
{
char infO[100]; // <- string to openssl
SSL_METHOD *method;
unsigned long options;
unsigned long mode;
......
}
//-----s3_srvr.c-----//
int ssl3_accept(SSL *s)
{
char *buf =3D s->ctx->infO; //NULL string !!!!! AND NEED GET inf from =
ssl_pphrase_Handle
......
}
Seems, struct SSL_CTX clearing after fork process, this so?
And How can save string after fork process?
Suggest to me idea.
Thanks.
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org