]> git.sur5r.net Git - openldap/commitdiff
cleanup
authorKurt Zeilenga <kurt@openldap.org>
Tue, 14 Dec 2010 21:14:31 +0000 (21:14 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 14 Dec 2010 21:14:31 +0000 (21:14 +0000)
libraries/libldap/vc.c

index d9f4be437216f1f8329136a14bd736d021718155..b412d32eddeaafe800f78f6907189a904db23e3e 100644 (file)
@@ -34,39 +34,39 @@ int ldap_parse_verify_credentials(
        LDAP *ld,
        LDAPMessage *res,
        struct berval **servercred,
-       struct berval **authzid )
+       struct berval **authzid)
 {
        int rc;
        char *retoid = NULL;
        struct berval *reqdata = NULL;
 
-       assert( ld != NULL );
-       assert( LDAP_VALID( ld ) );
-       assert( res != NULL );
-       assert( authzid != NULL );
+       assert(ld != NULL);
+       assert(LDAP_VALID(ld));
+       assert(res != NULL);
+       assert(authzid != NULL);
 
        *authzid = NULL;
 
-       rc = ldap_parse_extended_result( ld, res, &retoid, &reqdata, 0 );
+       rc = ldap_parse_extended_result(ld, res, &retoid, &reqdata, 0);
 
        if( rc != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_parse_whoami" );
+               ldap_perror(ld, "ldap_parse_whoami");
                return rc;
        }
 
-       ber_memfree( retoid );
+       ber_memfree(retoid);
        return rc;
 }
 
 int
-ldap_verify_credentials( LDAP *ld,
-        struct berval   *cookie,
-        LDAP_CONST char *dn,
-        LDAP_CONST char *mechanism,
-        struct berval   *cred,
-       LDAPControl     **sctrls,
-       LDAPControl     **cctrls,
-       int             *msgidp )
+ldap_verify_credentials(LDAP *ld,
+       struct berval   *cookie,
+       LDAP_CONST char *dn,
+       LDAP_CONST char *mechanism,
+       struct berval   *cred,
+       LDAPControl             **sctrls,
+       LDAPControl             **cctrls,
+       int                             *msgidp)
 {
        int rc;
        BerElement *ber;
@@ -81,37 +81,37 @@ ldap_verify_credentials( LDAP *ld,
        if (dn == NULL) dn = "";
 
        if (mechanism == LDAP_SASL_SIMPLE) {
-           assert(!cookie);
+               assert(!cookie);
 
-           rc = ber_printf(ber, "{istON}",
-               3, dn, LDAP_AUTH_SIMPLE, cred);
+               rc = ber_printf(ber, "{istON}",
+                       3, dn, LDAP_AUTH_SIMPLE, cred);
 
        } else {
-           if (!cred || BER_BVISNULL(cred)) {
-               if (cookie) {
-                   rc = ber_printf(ber, "{t0ist{sN}N}",
-                       LDAP_TAG_EXOP_VERIFY_CREDENTIALS_COOKIE, cookie,
-                       3, dn, LDAP_AUTH_SASL, mechanism);
-               } else {
-                   rc = ber_printf(ber, "{ist{sN}N}",
-                       3, dn, LDAP_AUTH_SASL, mechanism);
-               }
-           } else {
-               if (cookie) {
-                   rc = ber_printf(ber, "{tOist{sON}N}",
-                       LDAP_TAG_EXOP_VERIFY_CREDENTIALS_COOKIE, cookie,
-                       3, dn, LDAP_AUTH_SASL, mechanism, cred);
+               if (!cred || BER_BVISNULL(cred)) {
+                       if (cookie) {
+                               rc = ber_printf(ber, "{t0ist{sN}N}",
+                                       LDAP_TAG_EXOP_VERIFY_CREDENTIALS_COOKIE, cookie,
+                                       3, dn, LDAP_AUTH_SASL, mechanism);
+                       } else {
+                               rc = ber_printf(ber, "{ist{sN}N}",
+                                       3, dn, LDAP_AUTH_SASL, mechanism);
+                       }
                } else {
-                   rc = ber_printf(ber, "{ist{sON}N}",
-                       3, dn, LDAP_AUTH_SASL, mechanism, cred);
+                       if (cookie) {
+                               rc = ber_printf(ber, "{tOist{sON}N}",
+                                       LDAP_TAG_EXOP_VERIFY_CREDENTIALS_COOKIE, cookie,
+                                       3, dn, LDAP_AUTH_SASL, mechanism, cred);
+                       } else {
+                               rc = ber_printf(ber, "{ist{sON}N}",
+                                       3, dn, LDAP_AUTH_SASL, mechanism, cred);
+                       }
                }
-           }
        }
 
        ber_flatten(ber, &reqdata);
 
        rc = ldap_extended_operation(ld, LDAP_EXOP_VERIFY_CREDENTIALS,
-           reqdata, sctrls, cctrls, msgidp);
+               reqdata, sctrls, cctrls, msgidp);
 
        ber_free(ber, 1);
        return rc;
@@ -120,18 +120,18 @@ ldap_verify_credentials( LDAP *ld,
 int
 ldap_verify_credentials_s(
        LDAP *ld,
-        struct berval   *cookie,
-        LDAP_CONST char *dn,
-        LDAP_CONST char *mechanism,
-        struct berval   *cred,
-       LDAPControl     **sctrls,
-       LDAPControl     **cctrls,
+       struct berval   *cookie,
+       LDAP_CONST char *dn,
+       LDAP_CONST char *mechanism,
+       struct berval   *cred,
+       LDAPControl             **sctrls,
+       LDAPControl             **cctrls,
        struct berval   **scred,
        struct berval   **authzid)
 {
-       int             rc;
-       int             msgid;
-       LDAPMessage     *res;
+       int                             rc;
+       int                             msgid;
+       LDAPMessage             *res;
 
        rc = ldap_verify_credentials(ld, cookie, dn, mechanism, cred, sctrls, cctrls, &msgid);
        if (rc != LDAP_SUCCESS) return rc;