diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-08-02 16:53:28 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-09-08 09:36:21 -0400 |
commit | 69aaef8719c5cf33ed1c4090fa313ba281bf8a02 (patch) | |
tree | fd53594df15164396635e2007c31f7ee91c6a9e3 /src/util/crypto/sss_crypto.h | |
parent | e5ba9ef0d556a6195db692f87deedbefc2fbef17 (diff) | |
download | sssd-69aaef8719c5cf33ed1c4090fa313ba281bf8a02.tar.gz sssd-69aaef8719c5cf33ed1c4090fa313ba281bf8a02.tar.xz sssd-69aaef8719c5cf33ed1c4090fa313ba281bf8a02.zip |
Password obfuscation utility functions
Adds two utility functions to obfuscate a password and inverse to
extract the cleartext password back.
So far, only NSS-based implementation is provided.
Diffstat (limited to 'src/util/crypto/sss_crypto.h')
-rw-r--r-- | src/util/crypto/sss_crypto.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/crypto/sss_crypto.h b/src/util/crypto/sss_crypto.h index 5512c5d96..66394aeb4 100644 --- a/src/util/crypto/sss_crypto.h +++ b/src/util/crypto/sss_crypto.h @@ -2,3 +2,17 @@ int s3crypt_sha512(TALLOC_CTX *mmectx, const char *key, const char *salt, char **_hash); int s3crypt_gen_salt(TALLOC_CTX *memctx, char **_salt); + +/* Methods of obfuscation. */ +enum obfmethod { + AES_256, + NUM_OBFMETHODS +}; + +int test2(void); + +int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen, + enum obfmethod meth, char **obfpwd); + +int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded, + char **password); |