Up to Contents

Back to Parsing LDAP URLs

Utility Functions

The functions in this section are specific to the Innosoft implementation.

          void ldap_time2generalized(time_t *t,char *buf,int buflen);

ldap_time2generalized() takes as input a pointer to a time_t value, and stores the GeneralizedTime string encoding of this time into buf. buflen should contain the size of the buffer, at least 32 bytes.

          char **ldap_charray_dup(char **);

ldap_charray_dup() makes a copy of an array of character pointers. The resulting array should be freed with ldap_value_free().

          char *ldap_cram_md5_challenge(void); 
          char *ldap_cram_md5_encode(char *challenge,char *pass);

ldap_cram_md5_challenge() creates a random CRAM-MD5 challenge string, such as <1896.69170952@po.reston.mci.net>. The resulting string should be freed using ldap_memfree().

ldap_cram_md5_encode() takes as argument a challenge string and a password value, and performs a Keyed-MD5 hash of these values as defined in CRAM-MD5. The result is hex-encoded and returned as a string, which should be freed using ldap_memfree(). This function can be used in clients which implement the CRAM-MD5 SASL mechanism.

 
          char *ldif_type_and_value( char *type, char *val, int vlen );

ldif_type_and_value() take as argument and attribute type name and a value, and produce a single line suitable for use in an LDIF file. The resulting string should be freed using ldap_memfree().

Up to Contents

Forward to Function Index