authtok.c revision 9acfb09f7969a69f58bd45c856b01700541853ca
/*
SSSD - auth utils
Copyright (C) Simo Sorce <simo@redhat.com> 2012
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 "authtok.h"
struct sss_auth_token {
enum sss_authtok_type type;
};
{
}
{
case SSS_AUTHTOK_TYPE_CCFILE:
case SSS_AUTHTOK_TYPE_EMPTY:
return 0;
}
return EINVAL;
}
{
}
{
case SSS_AUTHTOK_TYPE_EMPTY:
return ENOENT;
if (len) {
}
return EOK;
case SSS_AUTHTOK_TYPE_CCFILE:
return EACCES;
}
return EINVAL;
}
{
case SSS_AUTHTOK_TYPE_EMPTY:
return ENOENT;
case SSS_AUTHTOK_TYPE_CCFILE:
if (len) {
}
return EOK;
return EACCES;
}
return EINVAL;
}
enum sss_authtok_type type,
const char *context_name,
{
if (len == 0) {
} else {
}
if (len == 0) {
/* we do not allow zero length typed tokens */
return EINVAL;
}
return ENOMEM;
}
return EOK;
}
{
case SSS_AUTHTOK_TYPE_EMPTY:
return;
break;
case SSS_AUTHTOK_TYPE_CCFILE:
break;
}
}
{
}
{
}
enum sss_authtok_type type,
{
switch (type) {
case SSS_AUTHTOK_TYPE_CCFILE:
case SSS_AUTHTOK_TYPE_EMPTY:
return EOK;
}
return EINVAL;
}
struct sss_auth_token *dst)
{
return EOK;
}
return ENOMEM;
}
return EOK;
}
{
struct sss_auth_token *token;
}
return token;
}
{
return;
}
}