R: R: new Apache directives

1999-06-12 Thread Andrea e Luca Giacobazzi

>
>> I recommend you to look at existing configuration functions or read the
>> >excellent book from L.Stein and D.MacEachern "Writing Apache Modules in
>> Perl
>> >and C". There all those gory details are explained very well.
>> >
>> Unfortunately the book isn't still isuued in Italy !
>
>Err... www.amazon.com has the book and delivers world-wide, of course.
Already ordered...but I like to have it NOW ! (I'm getting it from a friend
of mine)
I bought also The Apache Bible, is it good ?

Good luck for your exams ! I will discuss too my final thesis in computer
engeneering in University of Modena, 17 June 1999, in the morning; my thesis
argument is OCSP protocol and client certificate status check with LDAP,
inside Apache, part of the Digital Signature Project for Modena
municipality, my city.
I'd like to send a clean version of my module in a few days, if you like to
consider it for the inclusion.
Thanks again

Andrea



__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]



Re: R: new Apache directives

1999-06-11 Thread Ralf S. Engelschall

On Fri, Jun 11, 1999, Andrea e Luca Giacobazzi wrote:

> Thanks Ralph, I succesfully added the new directives, like that:
> const char *ssl_cmd_SSLLdap(
> cmd_parms *cmd, SSLDirConfigRec *dc, char *arg)
> {
> SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
> 
> if (strcEQn(arg, "servers:", 8))
> sc->ldapServers = ap_pstrdup(cmd->pool, arg+8);
> else if (strcEQn(arg, "basedn:", 7))
> sc->ldapBaseDn = ap_pstrdup(cmd->pool, arg+7);
> else if (strcEQn(arg, "user:", 5))
> sc->ldapUser = ap_pstrdup(cmd->pool, arg+5);
> else if (strcEQn(arg, "pwd:", 4))
> sc->ldapPwd = ap_pstrdup(cmd->pool, arg+4);
> return NULL;
> 
> AP_SRV_CMD(Ldap, ITERATE,
>"Parameters for client certificate status check with LDAP
> directory"
>"servers=LdapHost, basedn=LdapBaseDn, user=LdapUser
> pwd=LdapPwd")
> AP_SRV_CMD(LdapVerifyClient, TAKE1,
>"Enable or disable client certificate status check with
> LDAP directory"
>"(`Enable', `Disable'")
> 
> But the last problem is that I can't read the value from that I put in
> server config during the directive parsing, from sc inside the routine
> ssl_callback_verify:
> 
> sc = myServerConfig(s);
> sc->ldapServers
> sc->ldapBaseDn
> ...

That's correct. As you can see in my code, I access the variables the same
way. When it doesn't work for you, you've messed up something. The usage is
correct. OTOH, why are you thinking you cannot access the variables this way?
Are the variables empty? Then make sure the functions at the top of
ssl_engine_config.c which do the config _merging_ also contain references to
your vars.

> I recommend you to look at existing configuration functions or read the
> >excellent book from L.Stein and D.MacEachern "Writing Apache Modules in
> Perl
> >and C". There all those gory details are explained very well.
> >
> Unfortunately the book isn't still isuued in Italy !

Err... www.amazon.com has the book and delivers world-wide, of course.

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com
__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]



R: new Apache directives

1999-06-11 Thread Andrea e Luca Giacobazzi


->
>Every function in ssl_engine_config.c has a hook in mod_ssl.c!
>What you need is something like this:
>
>AP_SRV_CMD(Ldap, RAW_ARGS, )
>
>Then you get the "server=..." string as one large thing.  You can also try
>ITERATE instead of RAW_ARGS, then you get a key=value pair per function
call.

Thanks Ralph, I succesfully added the new directives, like that:
const char *ssl_cmd_SSLLdap(
cmd_parms *cmd, SSLDirConfigRec *dc, char *arg)
{
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);

if (strcEQn(arg, "servers:", 8))
sc->ldapServers = ap_pstrdup(cmd->pool, arg+8);
else if (strcEQn(arg, "basedn:", 7))
sc->ldapBaseDn = ap_pstrdup(cmd->pool, arg+7);
else if (strcEQn(arg, "user:", 5))
sc->ldapUser = ap_pstrdup(cmd->pool, arg+5);
else if (strcEQn(arg, "pwd:", 4))
sc->ldapPwd = ap_pstrdup(cmd->pool, arg+4);
return NULL;

AP_SRV_CMD(Ldap, ITERATE,
   "Parameters for client certificate status check with LDAP
directory"
   "servers=LdapHost, basedn=LdapBaseDn, user=LdapUser
pwd=LdapPwd")
AP_SRV_CMD(LdapVerifyClient, TAKE1,
   "Enable or disable client certificate status check with
LDAP directory"
   "(`Enable', `Disable'")

But the last problem is that I can't read the value from that I put in
server config during the directive parsing, from sc inside the routine
ssl_callback_verify:

sc = myServerConfig(s);
sc->ldapServers
sc->ldapBaseDn
...

Any suggestion ?
Thanks

>
I recommend you to look at existing configuration functions or read the
>excellent book from L.Stein and D.MacEachern "Writing Apache Modules in
Perl
>and C". There all those gory details are explained very well.
>
Unfortunately the book isn't still isuued in Italy !

__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]



Re: new Apache directives

1999-06-09 Thread Ralf S. Engelschall

On Wed, Jun 09, 1999, Andrea e Luca Giacobazzi wrote:

>   I tryed to add a routine to process a new Apache directory SSLLdap, in
> ssl_engine_config.c:
> 
> const char *ssl_cmd_SSLLdap(
> cmd_parms *cmd, SSLDirConfigRec *dc, char *arg)
> {
> SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
> char *servers, *user, *pwd;
> FILE *fp;
> 
> sc->ldapServers = ap_server_root_relative(cmd->pool, arg);
> fp = fopen("/tmp/prova.log", "w");
> fprintf(fp, "%s", sc->ldapServers);
> fflush(fp);
> fclose(fp);
> return NULL;
> }
> 
> But the thing I miss is where the routines in ssl_engine_config.c are
> invoked and where the directives in httpd.conf are processed. I need to add
> the new one, like that:
> 
> SSLLdap servers="string" user="string" pwd="string"

Every function in ssl_engine_config.c has a hook in mod_ssl.c!
What you need is something like this:

AP_SRV_CMD(Ldap, RAW_ARGS, )

Then you get the "server=..." string as one large thing.  You can also try
ITERATE instead of RAW_ARGS, then you get a key=value pair per function call.
I recommend you to look at existing configuration functions or read the
excellent book from L.Stein and D.MacEachern "Writing Apache Modules in Perl
and C". There all those gory details are explained very well.

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com
__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]



RE: new Apache directives

1999-06-09 Thread David Harris


look at:

mod_ssl-2.2.7-1.3.6/pkg.sslmod/mod_ssl.c

at about line 144 for where the SSL configuration directives are defined for
the Apache through the module API.

http://www.apache.org/docs/misc/API.html#commands

Actually the whole document is great, but that internal link is the most
relevant part for this question.



 - David Harris
   Principal Engineer, DRH Internet Services


-Original Message-
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
On Behalf Of Andrea e Luca Giacobazzi
Sent:   Wednesday, June 09, 1999 2:28 PM
To: [EMAIL PROTECTED]
Subject:new Apache directives

  I tryed to add a routine to process a new Apache directory SSLLdap, in
ssl_engine_config.c:

const char *ssl_cmd_SSLLdap(
cmd_parms *cmd, SSLDirConfigRec *dc, char *arg)
{
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
char *servers, *user, *pwd;
FILE *fp;

sc->ldapServers = ap_server_root_relative(cmd->pool, arg);
fp = fopen("/tmp/prova.log", "w");
fprintf(fp, "%s", sc->ldapServers);
fflush(fp);
fclose(fp);
return NULL;
}

But the thing I miss is where the routines in ssl_engine_config.c are
invoked and where the directives in httpd.conf are processed. I need to add
the new one, like that:

SSLLdap servers="string" user="string" pwd="string"

Thanks
Andrea





__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]

__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]



new Apache directives

1999-06-09 Thread Andrea e Luca Giacobazzi

  I tryed to add a routine to process a new Apache directory SSLLdap, in
ssl_engine_config.c:

const char *ssl_cmd_SSLLdap(
cmd_parms *cmd, SSLDirConfigRec *dc, char *arg)
{
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
char *servers, *user, *pwd;
FILE *fp;

sc->ldapServers = ap_server_root_relative(cmd->pool, arg);
fp = fopen("/tmp/prova.log", "w");
fprintf(fp, "%s", sc->ldapServers);
fflush(fp);
fclose(fp);
return NULL;
}

But the thing I miss is where the routines in ssl_engine_config.c are
invoked and where the directives in httpd.conf are processed. I need to add
the new one, like that:

SSLLdap servers="string" user="string" pwd="string"

Thanks
Andrea





__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]