return r;
}
-struct sigopts {
+struct sshsigopt {
int ca;
char *namespaces;
};
-static struct sigopts *
-sigopts_parse(const char *opts, const char *path, u_long linenum,
+struct sshsigopt *
+sshsigopt_parse(const char *opts, const char *path, u_long linenum,
const char **errstrp)
{
- struct sigopts *ret;
+ struct sshsigopt *ret;
int r;
const char *errstr = NULL;
return NULL;
}
-static void
-sigopts_free(struct sigopts *opts)
+void
+sshsigopt_free(struct sshsigopt *opts)
{
if (opts == NULL)
return;
char *cp, *opts = NULL, *identities = NULL;
int r, found = 0;
const char *reason = NULL;
- struct sigopts *sigopts = NULL;
+ struct sshsigopt *sigopts = NULL;
if ((found_key = sshkey_new(KEY_UNSPEC)) == NULL) {
error("%s: sshkey_new failed", __func__);
}
}
debug3("%s:%lu: options %s", path, linenum, opts == NULL ? "" : opts);
- if ((sigopts = sigopts_parse(opts, path, linenum, &reason)) == NULL) {
+ if ((sigopts = sshsigopt_parse(opts, path, linenum, &reason)) == NULL) {
error("%s:%lu: bad options: %s", path, linenum, reason);
goto done;
}
}
done:
sshkey_free(found_key);
- sigopts_free(sigopts);
+ sshsigopt_free(sigopts);
return found ? 0 : SSH_ERR_KEY_NOT_FOUND;
}
struct sshbuf;
struct sshkey;
+struct sshsigopt;
typedef int sshsig_signer(struct sshkey *, u_char **, size_t *,
const u_char *, size_t, const char *, u_int, void *);
int sshsig_check_allowed_keys(const char *path, const struct sshkey *sign_key,
const char *principal, const char *ns);
+/* Parse zero or more allowed_keys signature options */
+struct sshsigopt *sshsigopt_parse(const char *opts,
+ const char *path, u_long linenum, const char **errstrp);
+
+/* Free signature options */
+void sshsigopt_free(struct sshsigopt *opts);
+
#endif /* SSHSIG_H */