-/* $OpenBSD: rrdp_delta.c,v 1.5 2021/11/03 13:30:56 claudio Exp $ */
+/* $OpenBSD: rrdp_delta.c,v 1.6 2021/11/09 11:01:04 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
PARSE_FAIL(p, "parse failed - content too big");
}
+static void
+delta_doctype_handler(void *data, const char *doctypeName,
+ const char *sysid, const char *pubid, int subset)
+{
+ struct delta_xml *dxml = data;
+ XML_Parser p = dxml->parser;
+
+ PARSE_FAIL(p, "parse failed - DOCTYPE not allowed");
+}
+
struct delta_xml *
new_delta_xml(XML_Parser p, struct rrdp_session *rs, struct rrdp *r)
{
delta_xml_elem_end);
XML_SetCharacterDataHandler(dxml->parser, delta_content_handler);
XML_SetUserData(dxml->parser, dxml);
+ XML_SetDoctypeDeclHandler(dxml->parser, delta_doctype_handler, NULL);
return dxml;
}
-/* $OpenBSD: rrdp_notification.c,v 1.10 2021/11/05 14:30:53 claudio Exp $ */
+/* $OpenBSD: rrdp_notification.c,v 1.11 2021/11/09 11:01:04 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
PARSE_FAIL(p, "parse failed - unexpected elem exit found");
}
+static void
+notification_doctype_handler(void *data, const char *doctypeName,
+ const char *sysid, const char *pubid, int subset)
+{
+ struct notification_xml *nxml = data;
+ XML_Parser p = nxml->parser;
+
+ PARSE_FAIL(p, "parse failed - DOCTYPE not allowed");
+}
+
struct notification_xml *
new_notification_xml(XML_Parser p, struct rrdp_session *repository,
struct rrdp_session *current, const char *notifyuri)
XML_SetElementHandler(nxml->parser, notification_xml_elem_start,
notification_xml_elem_end);
XML_SetUserData(nxml->parser, nxml);
+ XML_SetDoctypeDeclHandler(nxml->parser, notification_doctype_handler,
+ NULL);
return nxml;
}
-/* $OpenBSD: rrdp_snapshot.c,v 1.4 2021/11/03 13:30:56 claudio Exp $ */
+/* $OpenBSD: rrdp_snapshot.c,v 1.5 2021/11/09 11:01:04 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
PARSE_FAIL(p, "parse failed - content too big");
}
+static void
+snapshot_doctype_handler(void *data, const char *doctypeName,
+ const char *sysid, const char *pubid, int subset)
+{
+ struct snapshot_xml *sxml = data;
+ XML_Parser p = sxml->parser;
+
+ PARSE_FAIL(p, "parse failed - DOCTYPE not allowed");
+}
+
struct snapshot_xml *
new_snapshot_xml(XML_Parser p, struct rrdp_session *rs, struct rrdp *r)
{
snapshot_xml_elem_end);
XML_SetCharacterDataHandler(sxml->parser, snapshot_content_handler);
XML_SetUserData(sxml->parser, sxml);
+ XML_SetDoctypeDeclHandler(sxml->parser, snapshot_doctype_handler,
+ NULL);
return sxml;
}