cryptlib with apache

"M. Akila" <[email protected]>
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <[email protected]>
There is mistake...

THE ERROR CODE I GET IS -43 not -1

Hi,

My development platform is following:

RHEL 5.0, kernel 2.6.18-53.
Apache 2.0.63

SSL/TLS security is provided by mod_ssl that comes along with apache, which inturn uses openssl library.
We are trying to replace mod_ssl module with a new mod_ssl which uses cryptlib library.

In apache hooks "pre_config" we are initialising cryptlib

        status = cryptInit();
        apr_file_open(&debug_log_fp, "/usr/local/apache2_0_63/logs/crlssl_log", APR_APPEND | APR_WRITE | APR_CREATE,
APR_OS_DEFAULT,pconf);

        if (cryptStatusError(status))
                printf("Initialisation failed\n");
        else
                printf("Library initialization success\n");

In apache hooks pre_connection we created SSL serversession and set version as ssl3.0.

We tried to set private key for session. This is how we called.

        status = cryptCreateSession( &ctxt->session, CRYPT_UNUSED, CRYPT_SESSION_SSL_SERVER );

        if( status == CRYPT_ERROR_PARAM3 )      /* SSL/TLS session access not available */
          {
                    ap_log_cerror(APLOG_MARK, APLOG_INFO, 0,f->c,"CRYPT_ERROR_NOTAVAI");
        }

        if( cryptStatusError( status ) )
        {
                ap_log_cerror(APLOG_MARK, APLOG_INFO, 0,f->c,"cryptCreateSession() failed");
        }
              else
               {
                  ap_log_cerror(APLOG_MARK, APLOG_INFO, 0,f->c,"Session created successfully");
               }

        status = cryptSetAttribute( ctxt->session, CRYPT_SESSINFO_VERSION, 0 );

        if( cryptStatusError( status ) )
        {
                        ap_log_cerror(APLOG_MARK, APLOG_INFO, 0,f->c,"cryptSetAttribute to SSL protocol failed");
        }
        else
        {
                         ap_log_cerror(APLOG_MARK, APLOG_INFO, 0,f->c,"SetAttribute to SSL protocol success");
        }

        status = getPrivateKey( &privateKey, SERVER_PRIVKEY_FILE,USER_PRIVKEY_LABEL,TEST_PRIVKEY_PASSWORD );
        if( cryptStatusOK( status ) )
        {
                status = cryptSetAttribute( cryptSession,
                                        CRYPT_SESSINFO_PRIVATEKEY,
                                        privateKey );
                cryptDestroyContext( privateKey );

        }

cryptCreateSession & cryptSetAttribute - retturned success.

But getPrivateKey failed (error code -1).

I am using the server.p15 that comes along with cryptlib library to set private key and certificate for server

I have included the necessary headrers - test.h, file name.h

When i try to do the above in apache directory create or directrory merge functions it getPrivateKey returns success.

After initializing in hook "pre-connection", i wanted to activate the session in "input-filter"function.

Any help would be greatly appreciated. Any pointers to sites/persons who have done this before also will be good.

Thanks again
Regards
Akila



Confidentiality Notice

The information contained in this electronic message and any 
attachments to this message are intended for the exclusive use of
the addressee(s) and may contain confidential or privileged 
information. If you are not the intended recipient, please notify
the sender at Bharat Electronics  or [email protected] immediately
and destroy all copies of this message and any attachments.



_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.