/*
SSSD
Library for rule based certificate to user mapping
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2017 Red Hat
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 <ctype.h>
#include "util/crypto/sss_crypto.h"
#include "lib/certmap/sss_certmap.h"
#include "lib/certmap/sss_certmap_int.h"
int debug_level;
long line,
const char *function,
int level,
const char *format, ...)
{
return;
}
char **type, const char **rule_start)
{
const char *c;
char *delim;
*rule_start = match_rule;
/* no type prefix found */
return 0;
}
/* rule starts with ':', empty type */
if (delim == match_rule) {
return EOK;
}
for (c = match_rule; c < delim; c++) {
/* type prefix may only contain digits and upper-case ASCII characters */
/* no type prefix found */
return 0;
}
}
return ENOMEM;
}
return 0;
}
struct krb5_match_rule **parsed_match_rule)
{
int ret;
char *type;
const char *rule_start;
goto done;
}
goto done;
}
} else {
goto done;
}
done:
return ret;
}
const char *mapping_rule,
struct ldap_mapping_rule **parsed_mapping_rule)
{
int ret;
char *type;
const char *rule_start;
goto done;
}
goto done;
}
} else {
goto done;
}
done:
return ret;
}
{
size_t c;
int ret;
struct priority_list *p;
return ENOMEM;
}
goto done;
}
if (match_rule == NULL) {
}
if (ret == 0) {
goto done;
}
/* report unsupported rules */
goto done;
} else {
goto done;
}
}
if (ret == 0) {
goto done;
}
/* report unsupported rules */
goto done;
} else {
goto done;
}
goto done;
}
goto done;
}
}
}
goto done;
}
} else {
p = p->next);
} else {
goto done;
}
if (p == NULL) {
} else {
}
}
}
done:
return ret;
}
struct parsed_template *parsed_template,
struct sss_cert_content *cert_content,
char **expanded)
{
int ret;
if (ret != 0) {
goto done;
}
goto done;
}
} else {
goto done;
}
ret = 0;
done:
if (ret == 0) {
} else {
}
return ret;
}
{
char *exp;
int ret;
if (ret != 0) {
return ret;
}
return 0;
}
}
return ENOENT;
}
char **expanded)
{
char *exp;
} else {
return EINVAL;
}
return ENOMEM;
}
return 0;
}
}
return ENOENT;
}
const char *conversion,
char **expanded)
{
char *exp;
int ret;
if (ret != 0) {
return ret;
}
return 0;
}
}
return ENOENT;
}
struct parsed_template *parsed_template,
char **expanded)
{
int ret;
} else {
}
return ret;
}
struct parsed_template *parsed_template,
struct sss_cert_content *cert_content,
char **expanded)
{
int ret;
} else {
goto done;
}
if (ret != 0) {
goto done;
}
goto done;
}
ret = 0;
done:
if (ret == 0) {
} else {
}
return ret;
}
struct ldap_mapping_rule *parsed_mapping_rule,
struct sss_cert_content *cert_content,
char **filter)
{
int ret;
return ENOMEM;
}
&expanded);
if (ret != 0) {
goto done;
}
goto done;
}
} else {
goto done;
}
}
ret = 0;
done:
if (ret == 0) {
} else {
}
return ret;
}
{
bool match = false;
int ret;
/* use LDAP order for matching */
return false;
}
} else {
}
if (!match) {
return false;
}
}
}
return match;
}
{
bool match = false;
return false;
}
if (!match) {
return false;
}
}
}
return match;
}
const char *str_other_name_oid,
{
bool match = false;
char *tmp_str;
if (str_other_name_oid == NULL) {
return false;
}
match = false;
item->bin_val_len);
}
}
if (!match) {
return false;
}
}
}
return match;
}
struct component_list *comp,
{
case SAN_OTHER_NAME:
return check_san_blob(SAN_STRING_OTHER_NAME,
san_list);
break;
case SAN_X400_ADDRESS:
case SAN_EDIPART_NAME:
san_list);
break;
case SAN_RFC822_NAME:
case SAN_DNS_NAME:
case SAN_DIRECTORY_NAME:
case SAN_URI:
case SAN_IP_ADDRESS:
case SAN_REGISTERED_ID:
case SAN_PKINIT:
case SAN_NT:
case SAN_PRINCIPAL:
break;
case SAN_STRING_OTHER_NAME:
break;
default:
return false;
}
}
struct krb5_match_rule *parsed_match_rule,
struct sss_cert_content *cert_content)
{
bool match = false;
size_t c;
return EINVAL;
}
/* Issuer */
0, NULL, 0) == 0);
/* match */
return 0;
/* no match */
return ENOENT;
}
}
/* Subject */
0, NULL, 0) == 0);
/* match */
return 0;
/* no match */
return ENOENT;
}
}
/* Key Usage */
/* match */
return 0;
/* no match */
return ENOENT;
}
}
/* Extended Key Usage */
true);
/* match */
return 0;
/* no match */
return ENOENT;
}
}
}
/* SAN */
/* match */
return 0;
/* no match */
return ENOENT;
}
}
if (match) {
/* match */
return 0;
}
/* no match */
return ENOENT;
}
{
int ret;
struct match_map_rule *r;
struct priority_list *p;
if (ret != 0) {
return ret;
}
/* Match all certificates if there are no rules applied */
ret = 0;
goto done;
}
if (ret == 0) {
/* match */
goto done;
}
}
}
done:
return ret;
}
{
int ret;
struct match_map_rule *r;
struct priority_list *p;
size_t c;
return EINVAL;
}
if (ret != 0) {
return ret;
}
return EINVAL;
}
goto done;
}
if (ret == 0) {
/* match */
&filter);
if (ret != 0) {
goto done;
}
goto done;
}
goto done;
}
}
}
ret = 0;
goto done;
}
}
}
done:
if (ret == 0) {
} else {
}
return ret;
}
struct sss_certmap_ctx **ctx)
{
int ret;
return EINVAL;
}
return ENOMEM;
}
&((*ctx)->default_mapping_rule));
if (ret != 0) {
talloc_free(*ctx);
return ret;
}
return EOK;
}
{
}
{
}