diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-04-11 00:31:50 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-04-13 09:07:10 -0400 |
commit | 943df8483b9f8a43df72121883ca67f17571d214 (patch) | |
tree | a9301004163a7033b4a342057c355da1ea49454b /server/providers/data_provider.h | |
parent | f16705ecade500f77b525d1a3df0109196c98ee0 (diff) | |
download | sssd-943df8483b9f8a43df72121883ca67f17571d214.tar.gz sssd-943df8483b9f8a43df72121883ca67f17571d214.tar.bz2 sssd-943df8483b9f8a43df72121883ca67f17571d214.zip |
Implement credentials caching in pam responder.
Implement credentials caching in pam responder.
Currently works only for the proxy backend.
Also cleanup pam responder code and mode common code in data provider.
(the data provider should never include responder private headers)
Diffstat (limited to 'server/providers/data_provider.h')
-rw-r--r-- | server/providers/data_provider.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/server/providers/data_provider.h b/server/providers/data_provider.h index 4b68a0bd..2c828fab 100644 --- a/server/providers/data_provider.h +++ b/server/providers/data_provider.h @@ -34,6 +34,7 @@ #include "sbus/sssd_dbus.h" #include "sbus/sbus_client.h" #include "providers/dp_interfaces.h" +#include "../sss_client/sss_cli.h" #define DATA_PROVIDER_VERSION 0x0001 #define DATA_PROVIDER_SERVICE_NAME "dp" @@ -80,4 +81,50 @@ #define BE_REQ_GROUP 2 #define BE_REQ_INITGROUPS 3 +/* AUTH related common data and functions */ + +#define DEBUG_PAM_DATA(level, pd) do { \ + if (level <= debug_level) pam_print_data(level, pd); \ +} while(0); + + +struct response_data { + int32_t type; + int32_t len; + uint8_t *data; + struct response_data *next; +}; + +struct pam_data { + int cmd; + uint32_t authtok_type; + uint32_t authtok_size; + uint32_t newauthtok_type; + uint32_t newauthtok_size; + char *domain; + char *user; + char *service; + char *tty; + char *ruser; + char *rhost; + uint8_t *authtok; + uint8_t *newauthtok; + + int pam_status; + int response_delay; + struct response_data *resp_list; + + bool offline_auth; +}; + +void pam_print_data(int l, struct pam_data *pd); + +int pam_add_response(struct pam_data *pd, enum response_type type, + int len, const uint8_t *data); + +bool dp_pack_pam_request(DBusMessage *msg, struct pam_data *pd); +bool dp_unpack_pam_request(DBusMessage *msg, struct pam_data *pd, DBusError *dbus_error); +bool dp_pack_pam_response(DBusMessage *msg, struct pam_data *pd); +bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *dbus_error); + #endif /* __DATA_PROVIDER_ */ |