Skip to content

Commit

Permalink
Added URL Encoding to the kerberos/src/krb_password_pwncheck.c code, …
Browse files Browse the repository at this point in the history
…fixed indenting.
  • Loading branch information
CboeSecurity committed Oct 4, 2019
1 parent 3afead2 commit 53b5dc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion common/curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ int queryUrl(const char* dest_url, struct MemoryStruct* chunk, int useInsecureSS

curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, dest_url);
char* escaped_url = curl_easy_escape(curl, dest_url, 0);
curl_easy_setopt(curl, CURLOPT_URL, escaped_url);

curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)chunk);
Expand All @@ -67,6 +68,7 @@ int queryUrl(const char* dest_url, struct MemoryStruct* chunk, int useInsecureSS
syslog(LOG_ERR, "pwncheck: queryUrl: curl_easy_perform() failed: %s", curl_easy_strerror(res));

/* always cleanup */
curl_free(escaped_url);
curl_easy_cleanup(curl);
}

Expand Down
11 changes: 8 additions & 3 deletions kerberos/src/krb_password_pwncheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ pwqual_pwncheck_check(krb5_context context, krb5_pwqual_moddata data,
int ret = DEF_PWD_RETURN; // default is unspecified issue
int isInsecure = FALSE;

struct cfgpwned config;
syslog(LOG_DEBUG, "pwncheck: check: started\n");
int retconfig = parseConfig(&config, "/etc/krb5-pwned-password.conf");
struct cfgpwned config;
syslog(LOG_DEBUG, "pwncheck: check: started\n");
int retconfig = parseConfig(&config, "/etc/krb5-pwned-password.conf");

//if (princ == NULL)
//{
// return ret;
//}

if (princ->data && krb5_princ_size(context, princ) > 0) {
user = princ->data[0].data;
Expand Down

0 comments on commit 53b5dc7

Please sign in to comment.