/*
SSSD
KCM Server - the KCM ccache operations
Copyright (C) Red Hat, 2016
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "util/crypto/sss_crypto.h"
#include "util/sss_krb5.h"
#include "responder/kcm/kcmsrv_ccache.h"
#include "responder/kcm/kcmsrv_ccache_pvt.h"
#include "responder/kcm/kcmsrv_ccache_be.h"
{
return 0;
}
return 0;
}
const char *name,
struct kcm_ccache **_cc)
{
return ENOMEM;
}
goto done;
}
goto done;
}
if (kret != 0) {
ret = ERR_INTERNAL;
goto done;
}
done:
}
return ret;
}
{
}
{
return EINVAL;
}
return EOK;
}
{
}
{
bool ok;
return false;
}
/* root can access any ccache */
return true;
}
if (!ok) {
}
return ok;
}
{
}
{
return EINVAL;
}
return ENOMEM;
}
return ret;
}
return EOK;
}
{
return NULL;
}
}
{
return NULL;
}
}
{
return NULL;
}
return kcreds;
}
/* Add a cred to ccache */
{
return EOK;
}
{
return EINVAL;
}
return EOK;
}
{
}
struct tevent_context *ev,
enum kcm_ccdb_be cc_be)
{
return NULL;
}
return NULL;
}
switch (cc_be) {
case CCDB_BE_MEMORY:
break;
case CCDB_BE_SECRETS:
break;
default:
break;
}
return NULL;
}
return NULL;
}
return ccdb;
}
struct kcm_ccdb_nextid_state {
char *next_cc;
};
struct tevent_context *ev,
{
return NULL;
}
goto immediate;
}
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_nextid_state);
unsigned int nextid;
"Failed to generate next UID [%d]: %s\n",
return;
}
nextid);
return;
}
}
char **_next_cc)
{
struct kcm_ccdb_nextid_state);
return EOK;
}
struct kcm_ccdb_list_state {
};
struct tevent_context *ev,
{
return NULL;
}
goto immediate;
}
ev,
client);
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_list_state);
"Failed to list all ccaches [%d]: %s\n",
return;
}
}
uuid_t **_uuid_list)
{
struct kcm_ccdb_list_state);
return EOK;
}
struct kcm_ccdb_get_default_state {
};
struct tevent_context *ev,
{
return NULL;
}
goto immediate;
}
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_get_default_state);
"Failed to get the default ccache [%d]: %s\n",
return;
}
}
{
struct kcm_ccdb_get_default_state);
/* The caller might supply a NULL dfl to just check if there is
* some default ccache
*/
}
return EOK;
}
struct kcm_ccdb_set_default_state {
};
struct tevent_context *ev,
{
return NULL;
}
goto immediate;
}
if (uuid_is_null(uuid)) {
/* NULL UUID means to just reset the default to 'no default' */
goto immediate;
}
} else {
/* Otherwise we need to check if the client can access the UUID
* about to be set as default
*/
goto immediate;
}
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_set_default_state);
bool ok;
"Failed to get cache by UUID [%d]: %s\n",
return;
}
return;
}
if (!ok) {
return;
}
return;
}
}
{
struct tevent_req);
struct kcm_ccdb_set_default_state);
"Failed to set the default ccache [%d]: %s\n",
return;
}
}
{
return EOK;
}
struct kcm_ccdb_getbyname_state {
};
struct tevent_context *ev,
const char *name)
{
return NULL;
}
goto immediate;
}
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_getbyname_state);
bool ok;
"Failed to get cache by name [%d]: %s\n",
return;
}
return;
}
if (!ok) {
return;
}
}
struct kcm_ccache **_cc)
{
struct kcm_ccdb_getbyname_state);
return EOK;
}
struct kcm_ccdb_getbyuuid_state {
};
struct tevent_context *ev,
{
return NULL;
}
goto immediate;
}
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_getbyuuid_state);
bool ok;
"Failed to get cache by UUID [%d]: %s\n",
return;
}
return;
}
if (!ok) {
return;
}
}
struct kcm_ccache **_cc)
{
struct kcm_ccdb_getbyuuid_state);
return EOK;
}
struct kcm_ccdb_name_by_uuid_state {
const char *name;
};
struct tevent_context *ev,
{
&state,
struct kcm_ccdb_name_by_uuid_state);
return NULL;
}
goto immediate;
}
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_name_by_uuid_state);
"Failed to resolve cache by UUID [%d]: %s\n",
return;
}
}
const char **_name)
{
struct kcm_ccdb_name_by_uuid_state);
return EOK;
}
struct kcm_ccdb_uuid_by_name_state {
};
struct tevent_context *ev,
const char *name)
{
&state,
struct kcm_ccdb_uuid_by_name_state);
return NULL;
}
goto immediate;
}
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_uuid_by_name_state);
"Failed to resolve cache by UUID [%d]: %s\n",
return;
}
}
{
struct kcm_ccdb_uuid_by_name_state);
return EOK;
}
struct kcm_ccdb_create_cc_state {
};
struct tevent_context *ev,
struct kcm_ccache *cc)
{
bool ok;
return NULL;
}
goto immediate;
}
if (!ok) {
goto immediate;
}
ev,
cc);
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_create_cc_state);
"Failed to create ccache [%d]: %s\n",
return;
}
}
{
return EOK;
}
{
return;
}
}
{
return;
}
}
}
struct kcm_ccdb_mod_cc_state {
};
struct tevent_context *ev,
struct kcm_mod_ctx *mod_cc)
{
return NULL;
}
goto immediate;
}
ev,
uuid,
mod_cc);
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_mod_cc_state);
"Failed to create ccache [%d]: %s\n",
return;
}
}
{
return EOK;
}
struct kcm_ccdb_store_cred_blob_state {
};
struct tevent_context *ev,
{
return NULL;
}
goto immediate;
}
ev,
uuid,
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_store_cred_blob_state);
"Failed to create ccache [%d]: %s\n",
return;
}
}
{
return EOK;
}
struct kcm_ccdb_delete_cc_state {
};
struct tevent_context *ev,
{
return NULL;
}
goto immediate;
}
goto immediate;
}
return req;
return req;
}
{
struct tevent_req);
struct kcm_ccdb_delete_cc_state);
"Failed to delete ccache [%d]: %s\n",
return;
}
/* The delete operation must also check if the deleted ccache was
* the default and reset the default if it was
*/
return;
}
}
{
struct tevent_req);
struct kcm_ccdb_delete_cc_state);
"Failed to get the default ccache [%d]: %s\n",
return;
}
/* The ccache about to be deleted was not the default, quit */
return;
}
/* If we deleted the default ccache, reset the default ccache to 'none' */
return;
}
}
{
struct tevent_req);
struct kcm_ccdb_delete_cc_state);
"Failed to NULL the default ccache [%d]: %s\n",
return;
}
}
{
return EOK;
}
{
return;
}
}
{
return ERR_KCM_WRONG_CCNAME_FORMAT;
}
return EOK;
}