From 18fd136fa155befe4e43f294c5629c178d5e6414 Mon Sep 17 00:00:00 2001
From: Valera V Harseko <vharseko@3a-systems.ru>
Date: Wed, 21 Oct 2026 08:52:49 +0000
Subject: [PATCH] GHSA-jr68-5c58-j463 DSMLv2 gateway changes XML data binding of other applications in the same JVM
---
opendj-dsml-servlet/src/test/java/org/opends/dsml/protocol/ByteStringUtilityTestCase.java | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/opendj-dsml-servlet/src/test/java/org/opends/dsml/protocol/ByteStringUtilityTestCase.java b/opendj-dsml-servlet/src/test/java/org/opends/dsml/protocol/ByteStringUtilityTestCase.java
index bfcda39..9a837c2 100644
--- a/opendj-dsml-servlet/src/test/java/org/opends/dsml/protocol/ByteStringUtilityTestCase.java
+++ b/opendj-dsml-servlet/src/test/java/org/opends/dsml/protocol/ByteStringUtilityTestCase.java
@@ -322,6 +322,42 @@
ByteStringUtility.setMaxUriContentLength(-1);
}
+ @DataProvider
+ public Object[][] convertibleValues()
+ {
+ return new Object[][] {
+ { "a string value", ByteString.valueOfUtf8("a string value") },
+ { new byte[] { 1, 2, 3 }, ByteString.wrap(new byte[] { 1, 2, 3 }) },
+ { URI.create("http://203.0.113.10/secret"),
+ ByteString.valueOfUtf8("http://203.0.113.10/secret") },
+ };
+ }
+
+ @Test(dataProvider = "convertibleValues")
+ public void testRequiredValueIsConverted(Object value, ByteString expected) throws Exception
+ {
+ assertEquals(ByteStringUtility.convertRequiredValue(value), expected);
+ }
+
+ /**
+ * The XML binding turns an anyURI whose lexical form java.net.URI rejects
+ * into a null value. Storing that would silently drop the value from the
+ * request, so it is reported to the client instead.
+ */
+ @Test(expectedExceptions = IOException.class,
+ expectedExceptionsMessageRegExp = ".*value is missing.*")
+ public void testMissingRequiredValueIsRejected() throws Exception
+ {
+ ByteStringUtility.convertRequiredValue(null);
+ }
+
+ @Test(expectedExceptions = IOException.class,
+ expectedExceptionsMessageRegExp = ".*value is missing.*")
+ public void testUnconvertibleRequiredValueIsRejected() throws Exception
+ {
+ ByteStringUtility.convertRequiredValue(Integer.valueOf(42));
+ }
+
@Test
public void testSchemeCheckPrecedesHostCheck() throws Exception
{
--
Gitblit v1.10.0