Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jul 2019 17:56:08 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r350473 - stable/12/lib/libgssapi
Message-ID:  <201907311756.x6VHu8YK004004@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Wed Jul 31 17:56:07 2019
New Revision: 350473
URL: https://svnweb.freebsd.org/changeset/base/350473

Log:
  MFC r350157:
  
  Use the __DECONST macro rather than hand rolling it.
  
  Obtained from:	CheriBSD
  Sponsored by:	DARPA, AFRL

Modified:
  stable/12/lib/libgssapi/gss_accept_sec_context.c
  stable/12/lib/libgssapi/gss_names.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libgssapi/gss_accept_sec_context.c
==============================================================================
--- stable/12/lib/libgssapi/gss_accept_sec_context.c	Wed Jul 31 17:51:06 2019	(r350472)
+++ stable/12/lib/libgssapi/gss_accept_sec_context.c	Wed Jul 31 17:56:07 2019	(r350473)
@@ -100,11 +100,11 @@ parse_header(const gss_buffer_t input_token, gss_OID m
 }		       
 
 static gss_OID_desc krb5_mechanism =
-{9, (void *)(uintptr_t) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"};
+{9, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02")};
 static gss_OID_desc ntlm_mechanism =
-{10, (void *)(uintptr_t) "\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a"};
+{10, __DECONST(void *, "\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a")};
 static gss_OID_desc spnego_mechanism =
-{6, (void *)(uintptr_t) "\x2b\x06\x01\x05\x05\x02"};
+{6, __DECONST(void *, "\x2b\x06\x01\x05\x05\x02")};
 
 static OM_uint32
 choose_mech(const gss_buffer_t input, gss_OID mech_oid)

Modified: stable/12/lib/libgssapi/gss_names.c
==============================================================================
--- stable/12/lib/libgssapi/gss_names.c	Wed Jul 31 17:51:06 2019	(r350472)
+++ stable/12/lib/libgssapi/gss_names.c	Wed Jul 31 17:56:07 2019	(r350473)
@@ -49,7 +49,7 @@
  * to that gss_OID_desc.
  */
 static gss_OID_desc GSS_C_NT_USER_NAME_storage =
-	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"};
+	{10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01")};
 gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_storage;
 
 /*
@@ -64,7 +64,7 @@ gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_stora
  * initialized to point to that gss_OID_desc.
  */
 static gss_OID_desc GSS_C_NT_MACHINE_UID_NAME_storage =
-	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"};
+	{10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02")};
 gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_storage;
 
 /*
@@ -79,7 +79,7 @@ gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_
  * initialized to point to that gss_OID_desc.
  */
 static gss_OID_desc GSS_C_NT_STRING_UID_NAME_storage =
-	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"};
+	{10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03")};
 gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_storage;
 
 /*
@@ -100,7 +100,7 @@ gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UI
  * implementations
  */
 static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_X_storage =
-	{6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x02"};
+	{6, __DECONST(void *, "\x2b\x06\x01\x05\x06\x02")};
 gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTBASED_SERVICE_X_storage;
 
 /*
@@ -115,7 +115,7 @@ gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTB
  * to point to that gss_OID_desc.
  */
 static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_storage =
-	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04"};
+	{10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04")};
 gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBASED_SERVICE_storage;
 
 /*
@@ -129,7 +129,7 @@ gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBAS
  * to that gss_OID_desc.
  */
 static gss_OID_desc GSS_C_NT_ANONYMOUS_storage =
-	{6, (void *)(uintptr_t)"\x2b\x06\01\x05\x06\x03"};
+	{6, __DECONST(void *, "\x2b\x06\01\x05\x06\x03")};
 gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_storage;
 
 /*
@@ -143,7 +143,7 @@ gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_stora
  * to that gss_OID_desc.
  */
 static gss_OID_desc GSS_C_NT_EXPORT_NAME_storage =
-	{6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x04"};
+	{6, __DECONST(void *, "\x2b\x06\x01\x05\x06\x04")};
 gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_storage;
 
 /*
@@ -153,7 +153,7 @@ gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_s
  *   is "GSS_KRB5_NT_PRINCIPAL_NAME".
  */
 static gss_OID_desc GSS_KRB5_NT_PRINCIPAL_NAME_storage =
-        {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01"};
+        {10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01")};
 gss_OID GSS_KRB5_NT_PRINCIPAL_NAME = &GSS_KRB5_NT_PRINCIPAL_NAME_storage;
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907311756.x6VHu8YK004004>