/*
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 {
};
{
}
{
if (!tok) {
return 0;
}
case SSS_AUTHTOK_TYPE_CCFILE:
case SSS_AUTHTOK_TYPE_2FA:
case SSS_AUTHTOK_TYPE_SC_PIN:
case SSS_AUTHTOK_TYPE_EMPTY:
return 0;
}
return EINVAL;
}
{
if (!tok) {
return NULL;
}
}
{
if (!tok) {
return EFAULT;
}
case SSS_AUTHTOK_TYPE_EMPTY:
return ENOENT;
if (len) {
}
return EOK;
case SSS_AUTHTOK_TYPE_CCFILE:
case SSS_AUTHTOK_TYPE_2FA:
case SSS_AUTHTOK_TYPE_SC_PIN:
return EACCES;
}
return EINVAL;
}
{
if (!tok) {
return EINVAL;
}
case SSS_AUTHTOK_TYPE_EMPTY:
return ENOENT;
case SSS_AUTHTOK_TYPE_CCFILE:
if (len) {
}
return EOK;
case SSS_AUTHTOK_TYPE_2FA:
case SSS_AUTHTOK_TYPE_SC_PIN:
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;
}
{
if (!tok) {
return;
}
case SSS_AUTHTOK_TYPE_EMPTY:
return;
case SSS_AUTHTOK_TYPE_2FA:
case SSS_AUTHTOK_TYPE_SC_PIN:
break;
case SSS_AUTHTOK_TYPE_CCFILE:
break;
}
}
{
}
{
}
enum sss_authtok_type type,
{
switch (type) {
case SSS_AUTHTOK_TYPE_CCFILE:
case SSS_AUTHTOK_TYPE_2FA:
case SSS_AUTHTOK_TYPE_SC_PIN:
return EOK;
case SSS_AUTHTOK_TYPE_EMPTY:
return EOK;
}
return EINVAL;
}
struct sss_auth_token *dst)
{
return EINVAL;
}
return EOK;
}
return ENOMEM;
}
return EOK;
}
{
}
return token;
}
{
return;
}
}
{
size_t c;
return EINVAL;
}
c = 0;
return EINVAL;
}
if (fa1_len != 0) {
return ENOMEM;
}
} else {
}
if (fa2_len != 0) {
fa2_len);
talloc_free(*fa1);
return ENOMEM;
}
} else {
}
/* Re-calculate length for the case where \0 was missing in the blob */
return EOK;
}
{
int ret;
char *fa1;
char *fa2;
goto done;
}
goto done;
}
goto done;
}
done:
}
return ret;
}
{
size_t c;
}
return EINVAL;
}
c = 0;
return EINVAL;
}
return EINVAL;
}
return EOK;
}
{
int ret;
return EINVAL;
}
&needed_size);
"sss_auth_pack_2fa_blob unexpectedly returned [%d].\n", ret);
return EINVAL;
}
return ENOMEM;
}
return ret;
}
return EOK;
}
{
return EFAULT;
}
return EINVAL;
}
}
{
if (!tok) {
return EFAULT;
}
case SSS_AUTHTOK_TYPE_EMPTY:
return ENOENT;
case SSS_AUTHTOK_TYPE_SC_PIN:
if (len) {
}
return EOK;
case SSS_AUTHTOK_TYPE_CCFILE:
case SSS_AUTHTOK_TYPE_2FA:
return EACCES;
}
return EINVAL;
}
{
if (!tok) {
return;
}
}