]> git.sur5r.net Git - openldap/blobdiff - servers/ldapd/certificate.c
Replace strdup() with ch_strdup() such that exit() will be called
[openldap] / servers / ldapd / certificate.c
index 1299b0cf55fa53e922738e3f6296979fbd703ce4..be12fed1344a16aef6cab2127c52108be5e703b5 100644 (file)
 #include <quipu/ds_search.h>
 #include <quipu/dap2.h>
 #include <quipu/dua.h>
+extern sntx_table *get_syntax_table( short int sntx );
+extern PE asn2pe( char * );
 
 #include "lber.h"
 #include "ldap.h"
 #include "common.h"
 
-int ldap_certif_print( PS ps, struct certificate *parm, int format )
+int
+ldap_certif_print( PS ps, struct certificate *parm, int format )
 {
        Debug( LDAP_DEBUG_TRACE, "ldap_certif_print()\n", 0, 0, 0 );
 
@@ -114,7 +117,8 @@ ldap_print_algid( PS ps, struct alg_id *parm, int format )
    }
 }
 
-struct certificate *ldap_str2cert( char *str )
+struct certificate *
+ldap_str2cert( char *str )
 {
 struct certificate *result;
 char *ptr;
@@ -280,8 +284,6 @@ OID oid;
 void
 ldap_str2alg( char *str, struct alg_id *alg )
 {
-PE asn2pe();
-
   if ((str == NULLCP) || (*str == '\0'))
    {
      alg->asn = NULLPE;
@@ -305,13 +307,12 @@ PE asn2pe();
     }
 }
 
-void certif_init()
+void
+certif_init( void )
 {
-       extern short    ldap_certif_syntax;
        sntx_table      *syntax_table;
-       extern sntx_table *get_syntax_table();
 
-       if (syntax_table = get_syntax_table(ldap_certif_syntax)) {
+       if ((syntax_table = get_syntax_table(ldap_certif_syntax)) != NULL) {
                syntax_table->s_print = (void *) ldap_certif_print;
                syntax_table->s_parse = (void *) ldap_str2cert;
        } else