[libvirt] [PATCH 14/19] util: buffer: Encode URIs with upper case hex characters

Peter Krempa posted 19 patches 6 years, 3 months ago
[libvirt] [PATCH 14/19] util: buffer: Encode URIs with upper case hex characters
Posted by Peter Krempa 6 years, 3 months ago
rfc3986 uses uppercase characters so switch to using them as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/util/virbuffer.c | 2 +-
 tests/viruritest.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index bde118a248..2256bd5de5 100644
--- a/src/util/virbuffer.c
+++ b/src/util/virbuffer.c
@@ -663,7 +663,7 @@ virBufferURIEncodeString(virBufferPtr buf, const char *str)
     int grow_size = 0;
     const char *p;
     unsigned char uc;
-    const char *hex = "0123456789abcdef";
+    const char *hex = "0123456789ABCDEF";

     if ((buf == NULL) || (str == NULL))
         return;
diff --git a/tests/viruritest.c b/tests/viruritest.c
index a11587e52b..07cf7261d1 100644
--- a/tests/viruritest.c
+++ b/tests/viruritest.c
@@ -184,7 +184,7 @@ mymain(void)
         { NULL, NULL, false },
     };
     TEST_FULL("spice://[3ffe::104]:5900/?tlsSubject=C=XX,L=Testtown,O=Test%20Company,CN=tester.test",
-              "spice://[3ffe::104]:5900/?tlsSubject=C%3dXX%2cL%3dTesttown%2cO%3dTest%20Company%2cCN%3dtester.test",
+              "spice://[3ffe::104]:5900/?tlsSubject=C%3DXX%2CL%3DTesttown%2CO%3DTest%20Company%2CCN%3Dtester.test",
               "spice", "3ffe::104", 5900, "/", "tlsSubject=C=XX,L=Testtown,O=Test%20Company,CN=tester.test", NULL, NULL, spiceparams);

     virURIParam params1[] = {
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 14/19] util: buffer: Encode URIs with upper case hex characters
Posted by Ján Tomko 6 years, 3 months ago
On Thu, Oct 24, 2019 at 03:56:32PM +0200, Peter Krempa wrote:
>rfc3986 uses uppercase characters so switch to using them as well.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/util/virbuffer.c | 2 +-
> tests/viruritest.c   | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list