]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common source files not applicable to open-vm-tools.
authorKaty Feng <fkaty@vmware.com>
Thu, 6 Apr 2023 18:27:41 +0000 (11:27 -0700)
committerKaty Feng <fkaty@vmware.com>
Thu, 6 Apr 2023 18:27:41 +0000 (11:27 -0700)
open-vm-tools/configure.ac
open-vm-tools/vgauth/Makefile.am
open-vm-tools/vgauth/common/VGAuthProto.h
open-vm-tools/vgauth/lib/VGAuthInt.h
open-vm-tools/vgauth/lib/auth.c
open-vm-tools/vgauth/public/VGAuthAuthentication.h
open-vm-tools/vgauth/serviceImpl/saml-xml-security-c.cpp
open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c
open-vm-tools/vgauth/serviceImpl/samlInt.hpp
open-vm-tools/vgauth/serviceImpl/serviceInt.h

index 8016001f0aa70013b4135e19030ae9b2e62200b9..e4cea962af1e1883befee74c03324c62fed4615f 100644 (file)
@@ -1954,6 +1954,9 @@ AC_CONFIG_FILES([                      \
 
 
 
+
+
+
 ###
 ### Output
 ###
index 3f94cdfc31c5cf963ec943ae26cd6d52fe4c5e89..a984425bc130fc05826e05e048c9a400c032bc0f 100644 (file)
@@ -1,5 +1,5 @@
 ################################################################################
-### Copyright (C) 2014-2017 VMware, Inc.  All rights reserved.
+### Copyright (c) 2014-2017,2023 VMware, Inc.  All rights reserved.
 ###
 ### This program is free software; you can redistribute it and/or modify
 ### it under the terms of version 2 of the GNU General Public License as
index 0d7e125f14b0455e56c71a16871aad81d990fa5d..fda18e51d4158d333401a2e131ed56a45d914d74 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2016,2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -21,6 +21,8 @@
 
 #include "VGAuthError.h"
 
+/* clang-format off */
+
 /*
  * @file VGAuthProto.h
  *
 
 #define VGAUTH_REQUESTVALIDATESAMLBEARERTOKEN_ELEMENT_NAME "ValidateSamlBToken"
 
+
 #define VGAUTH_VALIDATESAMLBEARERTOKEN_REQUEST_FORMAT \
    VGAUTH_REQUEST_FORMAT_START \
       "<"VGAUTH_REQUESTNAME_ELEMENT_NAME">"VGAUTH_REQUESTVALIDATESAMLBEARERTOKEN_ELEMENT_NAME"</"VGAUTH_REQUESTNAME_ELEMENT_NAME">" \
       "<"VGAUTH_VALIDATE_ONLY_ELEMENT_NAME">%s</"VGAUTH_VALIDATE_ONLY_ELEMENT_NAME">" \
    VGAUTH_REQUEST_FORMAT_END
 
+
 #define VGAUTH_VALIDATESAMLBEARERTOKEN_REPLY_FORMAT_START \
    VGAUTH_REPLY_FORMAT_START \
        "<"VGAUTH_USERNAME_ELEMENT_NAME">%s</"VGAUTH_USERNAME_ELEMENT_NAME">" \
    VGAUTH_USERHANDLESAMLINFO_FORMAT_END \
    VGAUTH_REPLY_FORMAT_END
 
+/* clang-format on */
 #endif   // _VGAUTHPROTO_H_
index 564233a29c7492bf834bf5f81fb34d88c3029c73..a9570bae4f10370eff826171977f78cd1a2cb4fc 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2017,2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -243,12 +243,16 @@ VGAuthError VGAuth_SendQueryMappedAliasesRequest(VGAuthContext *ctx,
                                                  int *num,            // OUT
                                                  VGAuthMappedAlias **maList); // OUT
 
+/* clang-format off */
 VGAuthError VGAuth_SendValidateSamlBearerTokenRequest(VGAuthContext *ctx,
                                                       gboolean validateOnly,
                                                       const char *samlToken,
                                                       const char *userName,
                                                       VGAuthUserHandle **userHandle);
 
+
+/* clang-format on */
+
 VGAuthError VGAuth_CreateHandleForUsername(VGAuthContext *ctx,
                                            const char *userName,
                                            VGAuthUserHandleType type,
index e9b0485725255a65c1087a09010607d3523c067e..8d9d61c9a60a5d73f5c175fb3b8ddf1a50e5bde6 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2017,2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -409,7 +409,7 @@ VGAuth_ValidateSSPIResponse(VGAuthContext *ctx,
  *        authenticated.</li>
  * </ol>
  *
- * @remark One @a extraParams is supported:
+ * @remark Supported @a extraParams:
  *         VGAUTH_PARAM_VALIDATE_INFO_ONLY, which must have the value
  *         VGAUTH_PARAM_VALUE_TRUE or VGAUTH_PARAM_VALUE_FALSE.
  *         If set, SAML token validation is done, but the returned
index 8925c1fbb2dbdd20f95c245971ee9486361f475f..deeae4ecdb7aa6af48db5627db7e0b09f4242620 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2019,2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -198,6 +198,7 @@ VGAuthError VGAuth_ValidateSSPIResponse(VGAuthContext *ctx,
 
 #define  VGAUTH_PARAM_VALIDATE_INFO_ONLY  "validateInfoOnly"
 
+
 VGAuthError VGAuth_ValidateSamlBearerToken(VGAuthContext *ctx,
                                            const char *samlToken,
                                            const char *userName,
index a70f6029733aab45b01a01e5814df5662f954f24..ad54dd6d164931985b52363be2df9f31b730891a 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2017,2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -463,7 +463,8 @@ SAML_VerifyBearerToken(const char *xmlText,
       VGAuthError err;
       SAMLTokenData token;
 
-      err = SAMLVerifyAssertion(xmlText, token, certs);
+      err = SAMLVerifyAssertion(xmlText,
+                                token, certs);
       if (VGAUTH_E_OK != err) {
          return err;
       }
@@ -497,13 +498,13 @@ SAML_VerifyBearerToken(const char *xmlText,
  * The token must first be verified, then the certificate chain used
  * verify it must be checked against the appropriate certificate store.
  *
- * @param[in]  xmlText     The text of the SAML assertion.
- * @param[in]  userName    Optional username to authenticate as.
- * @param[out] userNameOut The user that the token has authenticated as.
- * @param[out] subjNameOut The subject in the token.
- * @param[out] verifySi    The subjectInfo associated with the entry
- *                         in the ID provider store used to verify the
- *                         SAML cert.
+ * @param[in]  xmlText      The text of the SAML assertion.
+ * @param[in]  userName     Optional username to authenticate as.
+ * @param[out] userNameOut  The user that the token has authenticated as.
+ * @param[out] subjNameOut  The subject in the token.
+ * @param[out] verifySi     The subjectInfo associated with the entry
+ *                          in the ID provider store used to verify the
+ *                          SAML cert.
  *
  * @return VGAUTH_E_OK on success, VGAuthError on failure
  *
@@ -529,7 +530,8 @@ SAML_VerifyBearerTokenAndChain(const char *xmlText,
       ServiceSubject subj;
       int i;
 
-      err = SAMLVerifyAssertion(xmlText, token, certs);
+      err = SAMLVerifyAssertion(xmlText,
+                                token, certs);
       if (VGAUTH_E_OK != err) {
          return err;
       }
@@ -656,7 +658,8 @@ SAMLVerifyAssertion(const char *xmlText,
       return VGAUTH_E_AUTHENTICATION_DENIED;
    }
 
-   if (!SAMLCheckSignature(doc, certs)) {
+   if (!SAMLCheckSignature(doc,
+                           certs)) {
       return VGAUTH_E_AUTHENTICATION_DENIED;
    }
 
index 6e9d0fd24530535a53dafb538637af33cb544e07..09fd334631f1207a1c22ddd5b77a4999c45a77e9 100644 (file)
@@ -1230,10 +1230,10 @@ done:
  *
  * Verifies the signature on an XML document.
  *
- * @param[in]  doc       Parsed XML document.
- * @param[out] numCerts  Number of certs in the token.
- * @param[out] certChain Certs in the token. Caller should g_free() array and
- *                       contents.
+ * @param[in]  doc          Parsed XML document.
+ * @param[out] numCerts     Number of certs in the token.
+ * @param[out] certChain    Certs in the token. Caller should g_free() array and
+ *                          contents.
  *
  * @return TRUE on success.
  *
@@ -1314,6 +1314,7 @@ VerifySignature(xmlDocPtr doc,
       goto done;
    }
 
+
    /*
     * Create a signature context with the key manager
     */
@@ -1401,11 +1402,11 @@ done:
  * Verifies a XML text as a SAML token.
  * Parses the XML, then verifies Subject, Conditions and Signature.
  *
- * @param[in]  token     Text of SAML token.
- * @param[out] subject   Subject of SAML token,  Caller must g_free().
- * @param[out] numCerts  Number of certs in the token.
- * @param[out] certChain Certs in the token. Caller should g_free() array and
- *                       contents.
+ * @param[in]  token         Text of SAML token.
+ * @param[out] subject       Subject of SAML token,  Caller must g_free().
+ * @param[out] numCerts      Number of certs in the token.
+ * @param[out] certChain     Certs in the token. Caller should g_free()
+ *                           array and contents.
  *
  * @return matching TRUE on success.
  *
@@ -1470,7 +1471,8 @@ VerifySAMLToken(const gchar *token,
    }
 #endif
 
-   bRet = VerifySignature(doc, numCerts, certChain);
+   bRet = VerifySignature(doc,
+                          numCerts, certChain);
    if (FALSE == bRet) {
       g_warning("Failed to verify Signature\n");
       // XXX Can we log the token at this point without risking security?
@@ -1496,6 +1498,8 @@ done:
 }
 
 
+
+
 /*
  ******************************************************************************
  * SAML_VerifyBearerToken --                                             */ /**
@@ -1550,13 +1554,13 @@ SAML_VerifyBearerToken(const char *xmlText,
  * The token must first be verified, then the certificate chain used
  * verify it must be checked against the appropriate certificate store.
  *
- * @param[in]  xmlText     The text of the SAML assertion.
- * @param[in]  userName    Optional username to authenticate as.
- * @param[out] userNameOut The user that the token has authenticated as.
- * @param[out] subjNameOut The subject in the token.  Caller must g_free().
- * @param[out] verifyAi    The alias info associated with the entry
- *                         in the alias store used to verify the
- *                         SAML cert.
+ * @param[in]  xmlText      The text of the SAML assertion.
+ * @param[in]  userName     Optional username to authenticate as.
+ * @param[out] userNameOut  The user that the token has authenticated as.
+ * @param[out] subjNameOut  The subject in the token.  Caller must g_free().
+ * @param[out] verifyAi     The alias info associated with the entry
+ *                          in the alias store used to verify the
+ *                          SAML cert.
  *
  * @return VGAUTH_E_OK on success, VGAuthError on failure
  *
index e59a34d4f71d529da48d111b6adf49b96e1427e9..846d23309cffdf42f9b920509bd9bbac3bc90a82 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2016,2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
index ef49f42c26c2e5a06ae6f9f8c23fcb2821337ce2..42e5a2b23cec4b9c8037c3caa248521defda63fe 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2017,2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -479,6 +479,8 @@ gchar *ServiceEncodeUserName(const char *userName);
 gchar *ServiceDecodeUserName(const char *userName);
 
 VGAuthError SAML_Init(void);
+
+/* clang-format off */
 VGAuthError SAML_VerifyBearerToken(const char *xmlText,
                                    const char *userName,
                                    char **userNameOut,
@@ -489,6 +491,8 @@ VGAuthError SAML_VerifyBearerTokenAndChain(const char *xmlText,
                                            char **userNameOut,
                                            char **subjectNameOut,
                                            ServiceAliasInfo **verifyAi);
+/* clang-format on */
+
 void SAML_Shutdown(void);
 void SAML_Reload(void);