codesign_util.h 883 B

123456789101112131415161718192021222324
  1. // Copyright 2023 Microsoft, Inc.
  2. // Copyright 2013 The Chromium Authors
  3. // Use of this source code is governed by the MIT license that can be
  4. // found in the LICENSE file.
  5. #ifndef SHELL_COMMON_MAC_CODESIGN_UTIL_H_
  6. #define SHELL_COMMON_MAC_CODESIGN_UTIL_H_
  7. #include <unistd.h>
  8. namespace electron {
  9. // Given a pid, return true if the process has the same code signature with
  10. // with current app.
  11. // This API returns true if current app is not signed or ad-hoc signed, because
  12. // checking code signature is meaningless in this case, and failing the
  13. // signature check would break some features with unsigned binary (for example,
  14. // process.send stops working in processes created by child_process.fork, due
  15. // to the NODE_CHANNEL_ID env getting removed).
  16. bool ProcessSignatureIsSameWithCurrentApp(pid_t pid);
  17. } // namespace electron
  18. #endif // SHELL_COMMON_MAC_CODESIGN_UTIL_H_