summaryrefslogtreecommitdiffstats
path: root/ldadp.c
diff options
context:
space:
mode:
authorSimon Rettberg2015-04-28 15:54:45 +0200
committerSimon Rettberg2015-04-28 15:54:45 +0200
commitd611cc597822049b1bd091b6bf2f136e07ae53cf (patch)
tree6a31137cda1d6727123e668268d891d429b53c9d /ldadp.c
parent"Support" feature query (done by sssd) (diff)
downloadldadp-d611cc597822049b1bd091b6bf2f136e07ae53cf.tar.gz
ldadp-d611cc597822049b1bd091b6bf2f136e07ae53cf.tar.xz
ldadp-d611cc597822049b1bd091b6bf2f136e07ae53cf.zip
SSL support when talking to ADS
Diffstat (limited to 'ldadp.c')
-rw-r--r--ldadp.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/ldadp.c b/ldadp.c
index 584da8a..8d320a8 100644
--- a/ldadp.c
+++ b/ldadp.c
@@ -84,7 +84,7 @@ static void listen_callback(void *data, int haveIn, int haveOut, int doCleanup)
printf("Accepted connection.\n");
SSL *ssl = NULL;
if (listen->sslContext != NULL) {
- ssl = ssl_startAccept(sock, listen->sslContext);
+ ssl = ssl_new(sock, listen->sslContext);
if (ssl == NULL) {
close(sock);
return;
@@ -106,26 +106,32 @@ static void listen_callback(void *data, int haveIn, int haveOut, int doCleanup)
static int loadConfig_handler(void *stuff, const char *section, const char *key, const char *value)
{
- if (strcmp(key, "binddn") == 0) {
- server_setBind(section, value);
- }
- if (strcmp(key, "bindpw") == 0) {
- server_setPassword(section, value);
- }
- if (strcmp(key, "base") == 0) {
- server_setBase(section, value);
- }
- if (strcmp(key, "home") == 0 && *value != '\0') {
- server_setHomeTemplate(section, value);
- }
- if (strcmp(key, "port") == 0) {
- localPort = atoi(value);
- }
- if (strcmp(key, "cert") == 0) {
- certFile = strdup(value);
- }
- if (strcmp(key, "privkey") == 0) {
- keyFile = strdup(value);
+ if (strcmp(section, "local") == 0) {
+ if (strcmp(key, "port") == 0) {
+ localPort = atoi(value);
+ } else if (strcmp(key, "cert") == 0) {
+ certFile = strdup(value);
+ } else if (strcmp(key, "privkey") == 0) {
+ keyFile = strdup(value);
+ } else {
+ printf("Unknown local config option '%s'\n", key);
+ }
+ } else {
+ if (strcmp(key, "binddn") == 0) {
+ server_setBind(section, value);
+ } else if (strcmp(key, "bindpw") == 0) {
+ server_setPassword(section, value);
+ } else if (strcmp(key, "base") == 0) {
+ server_setBase(section, value);
+ } else if (strcmp(key, "home") == 0 && *value != '\0') {
+ server_setHomeTemplate(section, value);
+ } else if (strcmp(key, "fingerprint") == 0 && *value != '\0') {
+ server_setFingerprint(section, value);
+ } else if (strcmp(key, "port") == 0) {
+ server_setPort(section, value);
+ } else {
+ printf("Unknown ADS config option '%s' for server '%s'\n", key, section);
+ }
}
return 1;
}