diff options
author | Simo Sorce <simo@redhat.com> | 2014-01-06 11:56:41 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2014-01-12 18:20:20 -0500 |
commit | 95f99e2382e7d39fe275e8567a91824a7681dc3c (patch) | |
tree | d9487c9d8ff5ec3434adb9c824b582c0fb23b9c4 | |
parent | 8f99637195b6b7f29f1e6316c4de0a4f962d44f2 (diff) | |
download | gss-ntlmssp-95f99e2382e7d39fe275e8567a91824a7681dc3c.tar.gz gss-ntlmssp-95f99e2382e7d39fe275e8567a91824a7681dc3c.tar.xz gss-ntlmssp-95f99e2382e7d39fe275e8567a91824a7681dc3c.zip |
Expose cred store names in public header file.
Easier to use from clients this way.
-rw-r--r-- | src/gss_creds.c | 9 | ||||
-rw-r--r-- | src/gss_ntlmssp.h | 1 | ||||
-rw-r--r-- | src/gssapi_ntlmssp.h | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/gss_creds.c b/src/gss_creds.c index 03084a9..e4c759a 100644 --- a/src/gss_creds.c +++ b/src/gss_creds.c @@ -140,9 +140,6 @@ static int hex_to_key(const char *hex, struct ntlm_key *key) return 0; } -#define NTLM_CS_DOMAIN "ntlmssp_domain" -#define NTLM_CS_NTHASH "ntlmssp_nthash" -#define NTLM_CS_PASSWORD "ntlmssp_password" #define GENERIC_CS_PASSWORD "password" /* To support in future, RC4 Key is NT hash */ #define KRB5_CS_CLI_KEYTAB_URN "client_keytab" @@ -182,21 +179,21 @@ static int get_creds_from_store(struct gssntlm_name *name, if (cred->type != GSSNTLM_CRED_USER) return 0; for (i = 0; i < cred_store->count; i++) { - if (strcmp(cred_store->elements[i].key, NTLM_CS_DOMAIN) == 0) { + if (strcmp(cred_store->elements[i].key, GSS_NTLMSSP_CS_DOMAIN) == 0) { /* ignore duplicates */ if (cred->cred.user.user.data.user.domain) continue; cred->cred.user.user.data.user.domain = strdup(cred_store->elements[i].value); if (!cred->cred.user.user.data.user.domain) return ENOMEM; } - if (strcmp(cred_store->elements[i].key, NTLM_CS_NTHASH) == 0) { + if (strcmp(cred_store->elements[i].key, GSS_NTLMSSP_CS_NTHASH) == 0) { /* ignore duplicates */ if (cred->cred.user.nt_hash.length) continue; ret = hex_to_key(cred_store->elements[i].value, &cred->cred.user.nt_hash); if (ret) return ret; } - if ((strcmp(cred_store->elements[i].key, NTLM_CS_PASSWORD) == 0) || + if ((strcmp(cred_store->elements[i].key, GSS_NTLMSSP_CS_PASSWORD) == 0) || (strcmp(cred_store->elements[i].key, GENERIC_CS_PASSWORD) == 0)) { if (cred->cred.user.nt_hash.length) continue; cred->cred.user.nt_hash.length = 16; diff --git a/src/gss_ntlmssp.h b/src/gss_ntlmssp.h index 809f623..89da78d 100644 --- a/src/gss_ntlmssp.h +++ b/src/gss_ntlmssp.h @@ -20,6 +20,7 @@ #include "ntlm.h" #include "crypto.h" +#include "gssapi_ntlmssp.h" #define MAX_CHALRESP_LIFETIME 36 * 60 * 60 /* 36 hours in seconds */ diff --git a/src/gssapi_ntlmssp.h b/src/gssapi_ntlmssp.h index 42edafd..f34230f 100644 --- a/src/gssapi_ntlmssp.h +++ b/src/gssapi_ntlmssp.h @@ -47,6 +47,10 @@ extern "C" { #define GSS_NTLMSSP_SET_SEQ_NUM_OID_STRING GSS_NTLMSSP_BASE_OID_STRING "\x01" #define GSS_NTLMSSP_SET_SEQ_NUM_OID_LENGTH GSS_NTLMSSP_BASE_OID_LENGTH + 1 +#define GSS_NTLMSSP_CS_DOMAIN "ntlmssp_domain" +#define GSS_NTLMSSP_CS_NTHASH "ntlmssp_nthash" +#define GSS_NTLMSSP_CS_PASSWORD "ntlmssp_password" + #ifdef __cplusplus } #endif /* __cplusplus */ |