rever.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. #include <config.h>
  11. #endif
  12. #ifndef _REVER_H
  13. #define _REVER_H
  14. #include "slapi-plugin.h"
  15. #include "nspr.h"
  16. #include "base64.h"
  17. #include "slap.h"
  18. #include <plbase64.h>
  19. #define AES_MECH 1
  20. #define DES_MECH 2
  21. #define AES_REVER_SCHEME_NAME "AES"
  22. #define DES_REVER_SCHEME_NAME "DES"
  23. #define PWD_HASH_PREFIX_START '{'
  24. #define PWD_HASH_PREFIX_END '}'
  25. int rever_cmp(char *userpwd, char *dbpwd);
  26. char *rever_enc(char *pwd);
  27. char *rever_dec(char *pwd);
  28. int rever_init(Slapi_PBlock *pb);
  29. void init_pbe_plugin(void);
  30. int encode(char *inPlain, char **outCipher, int mech);
  31. int decode(char *inCipher, char **outPlain, int mech, char *algid);
  32. char *migrateCredentials(char *oldpath, char *newpath, char *oldcred);
  33. typedef char *(*migrate_fn_type)(char *, char *, char *);
  34. #endif