Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac builds failing due to sign_installer Notarization "Not signed" errors #3500

Open
andrew-m-leonard opened this issue Oct 10, 2023 · 69 comments
Labels
aarch Issues that affect or relate to the aarch ARCHITECTURE arm Issues that affect or relate to the ARM OS installer Issues that relate to our installer jobs or installer repo macos Issues that affect or relate to the MAC OS

Comments

@andrew-m-leonard
Copy link
Contributor

https://ci.adoptium.net/job/build-scripts/job/release/job/sign_installer/9894/console

Notarization failed: {"uuid":"b9809b86-4789-4655-937c-d3895b9bbafe","notarizationStatus":{"status":"ERROR","message":"Notarization has failed on Apple notarization service","moreInfo":"Failed to notarize the requested file (status=Invalid). Error code=OptionalInt.empty. Reason: Optional.empty","log":"{\n  \"logFormatVersion\": 1,\n  \"jobId\": \"b868a917-04c1-4e28-b5dd-5fb0d6bb37a5\",\n  \"status\": \"Invalid\",\n  \"statusSummary\": \"Archive contains critical validation errors\",\n  \"statusCode\": 4000,\n  \"archiveFilename\": \"OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg\",\n  \"uploadDate\": \"2023-10-10T08:57:27.708Z\",\n  \"sha256\": \"c6c5eef2408ff9160a140a2d59b90fdffcec3d44d783a5e824932b8b42d538b8\",\n  \"ticketContents\": null,\n  \"issues\": [\n    {\n      \"severity\": \"error\",\n      \"code\": null,\n      \"path\": \"OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libdt_socket.dylib\",\n      \"message\": \"The binary is not signed with a valid Developer ID certificate.\",\n      \"docUrl\": \"https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721\",\n      \"architecture\": \"arm64\"\n    },\n    {\n      \"severity\": \"error\",\n      \"code\": null,\n      \"path\": \"OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libdt_socket.dylib\",\n      \"message\": \"The signature does not include a secure timestamp.\",\n      \"docUrl\": \"https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733\",\n     

Examing the .dylib's show they look as though they are signed, but the Notarization service seems to not think so....

@github-actions github-actions bot added aarch Issues that affect or relate to the aarch ARCHITECTURE arm Issues that affect or relate to the ARM OS installer Issues that relate to our installer jobs or installer repo macos Issues that affect or relate to the MAC OS labels Oct 10, 2023
@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

The documentation link in the error states that:

You can only notarize apps that you sign with a Developer ID certificate. If you use any other certificate — like a Mac App Distribution certificate, or a self-signed certificate — notarization fails with the following message:

"path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libdt_socket.dylib",\n

"message": "The binary is not signed with a valid Developer ID certificate.",\n "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721\",\n "architecture": "arm64"\n },\n {\n "severity": "error",\n "code": null,\n

"path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libdt_socket.dylib",\n
"message": "The signature does not include a secure timestamp.",\n
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733\",\n

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

so it looks like 1 file in the archive is not signed and has no secure timestamp?

Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libdt_socket.dylib

@andrew-m-leonard
Copy link
Contributor Author

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

From the build script I see that you first use the code signing api at https://cbi.eclipse.org/macos/codesign/sign to sign the file and then notarize the archive. Maybe something in the signing went wrong, inspecting the logs. Do we also have a trace if the file in question libdt_socket.dylib is actually being signed?

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

In the error logs of the codesign service I dont find anything related to the libdt_socket.dylib file. The access logs dont indicate the file to be signed.

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

This line selects all dylib with certain permissions to be setup for signing:

FILES=$(find "${TMP_DIR}" -perm +111 -type f -not -name '.*' -o -name '*.dylib' || find "${TMP_DIR}" -perm /111 -type f -not -name '.*' -o -name '*.dylib')

could it be that this specific file ha different permissions and is thus not included?

@andrew-m-leonard
Copy link
Contributor Author

Here is the build log showing the signing of libdt_socket.dylib by that loop:

09:40:38  + for f in $FILES
09:40:38  + echo 'Signing workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/libdt_socket.dylib using Eclipse Foundation codesign service'
09:40:38  Signing workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/libdt_socket.dylib using Eclipse Foundation codesign service
09:40:38  ++ dirname workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/libdt_socket.dylib
09:40:38  + dir=workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent
09:40:38  ++ basename workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/libdt_socket.dylib
09:40:38  + file=libdt_socket.dylib
09:40:38  + mv workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/libdt_socket.dylib workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/unsigned_libdt_socket.dylib
09:40:38  + curl -o workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/libdt_socket.dylib -F file=@workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/unsigned_libdt_socket.dylib -F entitlements=@/var/jenkins/workspace/build-scripts/jobs/release/jobs/jdk17u/jdk17u-release-mac-aarch64-temurin/entitlements.plist https://cbi.eclipse.org/macos/codesign/sign
09:40:38    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
09:40:38                                   Dload  Upload   Total   Spent    Left  Speed
09:40:38  
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  144k  100 73376  100 74167   429k   433k --:--:-- --:--:-- --:--:--  862k
09:40:38  + chmod --reference=workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/unsigned_libdt_socket.dylib workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/libdt_socket.dylib
09:40:38  + rm -rf workspace/build/src/build/macosx-aarch64-server-release/support/modules_libs/jdk.jdwp.agent/unsigned_libdt_socket.dylib

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

I could see the request in the access log, and there was no error during signing.

I could retrieve the full log when using notarytool to notarize the package:

{
  "logFormatVersion": 1,
  "jobId": "b868a917-04c1-4e28-b5dd-5fb0d6bb37a5",
  "status": "Invalid",
  "statusSummary": "Archive contains critical validation errors",
  "statusCode": 4000,
  "archiveFilename": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg",
  "uploadDate": "2023-10-10T08:57:27.708Z",
  "sha256": "c6c5eef2408ff9160a140a2d59b90fdffcec3d44d783a5e824932b8b42d538b8",
  "ticketContents": null,
  "issues": [
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libdt_socket.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libdt_socket.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libjdwp.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jdwp.agent.jmod/lib/libjdwp.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jpackage.jmod/classes/jdk/jpackage/internal/resources/jpackageapplauncher",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jpackage.jmod/classes/jdk/jpackage/internal/resources/jpackageapplauncher",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.jpackage.jmod/classes/jdk/jpackage/internal/resources/jpackageapplauncher",
      "message": "The executable does not have the hardened runtime enabled.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087724",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.management.jmod/lib/libmanagement_ext.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.management.jmod/lib/libmanagement_ext.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.rmi.jmod/lib/librmi.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.rmi.jmod/lib/librmi.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.net.jmod/lib/libextnet.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.net.jmod/lib/libextnet.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.prefs.jmod/lib/libprefs.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.prefs.jmod/lib/libprefs.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libnet.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libnet.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libnio.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libnio.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libzip.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libzip.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libjimage.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libjimage.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libosxsecurity.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libosxsecurity.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libjava.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.base.jmod/lib/libjava.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libsplashscreen.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libsplashscreen.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libosxui.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libosxui.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libawt_lwawt.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libawt_lwawt.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libjavajpeg.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libjavajpeg.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libmlib_image.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libmlib_image.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libjsound.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libjsound.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libjawt.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libjawt.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libfontmanager.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libfontmanager.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/liblcms.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/liblcms.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libawt.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libawt.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libosx.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libosx.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libosxapp.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.desktop.jmod/lib/libosxapp.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.attach.jmod/lib/libattach.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.attach.jmod/lib/libattach.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.management.jmod/lib/libmanagement.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.management.jmod/lib/libmanagement.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.instrument.jmod/lib/libinstrument.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/java.instrument.jmod/lib/libinstrument.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.management.agent.jmod/lib/libmanagement_agent.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.management.agent.jmod/lib/libmanagement_agent.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.security.auth.jmod/lib/libjaas.dylib",
      "message": "The binary is not signed with a valid Developer ID certificate.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
      "architecture": "arm64"
    },
    {
      "severity": "error",
      "code": null,
      "path": "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1-5618895206704016833.pkg/net.temurin.17.jdk.pkg Contents/Payload/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/jmods/jdk.security.auth.jmod/lib/libjaas.dylib",
      "message": "The signature does not include a secure timestamp.",
      "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
      "architecture": "arm64"
    }
  ]
}

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

so its not only a single file but many, but all of them are inside jmods.

Could it be that the dylibs that are packaged in the jmods have not been signed, and notarytool does now also check if they are signed as well, which it did not do before?

@andrew-m-leonard
Copy link
Contributor Author

I've unzipped the archive OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8.1_1.tar.gz:
And the Home/lib/libdt_socket.dylib does show as signed:

anleonar@anleonar-mac Downloads % codesign -dvvv jdk-17.0.8.1+1/Contents/Home/lib/libdt_socket.dylib
Executable=/Users/anleonar/Downloads/jdk-17.0.8.1+1/Contents/Home/lib/libdt_socket.dylib
Identifier=SigningServlet-7530518851525430414-unsigned_libdt_socket
Format=Mach-O thin (arm64)
CodeDirectory v=20500 size=772 flags=0x10000(runtime) hashes=14+5 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=5ae8ec416a1c5a2681aa6c553dace343180b172d
CandidateCDHashFull sha256=5ae8ec416a1c5a2681aa6c553dace343180b172dffcdc1311fea6a2fcffcd566
Hash choices=sha256
CMSDigest=5ae8ec416a1c5a2681aa6c553dace343180b172dffcdc1311fea6a2fcffcd566
CMSDigestType=2
CDHash=5ae8ec416a1c5a2681aa6c553dace343180b172d
Signature size=8998
Authority=Developer ID Application: Eclipse Foundation, Inc. (JCDTMS22B4)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=10 Oct 2023 at 09:51:37
Info.plist=not bound
TeamIdentifier=JCDTMS22B4
Runtime Version=11.1.0
Sealed Resources=none
Internal requirements count=1 size=216

However ! The jdk-17.0.8.1+1/Contents/Home/jmods/jdk.jdwp.agent.jmod(libdt_socket.dylib) does not:

anleonar@anleonar-mac jmods % codesign -dvvv lib/libdt_socket.dylib
Executable=/Users/anleonar/Downloads/jdk-17.0.8.1+1/Contents/Home/jmods/lib/libdt_socket.dylib
Identifier=libdt_socket-555549446044422ba42e37d88da3986aae019e7a
Format=Mach-O thin (arm64)
CodeDirectory v=20400 size=750 flags=0x2(adhoc) hashes=14+5 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=cf4f8721822cb51d3e504f654b422f88471d26af
CandidateCDHashFull sha256=cf4f8721822cb51d3e504f654b422f88471d26aff146fd408114ebff082c9cad
Hash choices=sha256
CMSDigest=cf4f8721822cb51d3e504f654b422f88471d26aff146fd408114ebff082c9cad
CMSDigestType=2
CDHash=cf4f8721822cb51d3e504f654b422f88471d26af
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=0 size=12

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

  if [[ "${BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]}" == "true" ]]; then
    # This is required so that make will only touch the jmods and not re-compile them after signing
    FULL_MAKE_COMMAND="make -t \&\& ${FULL_MAKE_COMMAND}"
  fi

That sounds like the jmods do not include the signed dylibs after signing.

The currently running build has this set:

13:59:51 BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]="true"

So from my naive understanding of the build where I see that the jmods are built quite early on, you would have to sign the dylibs that are used to create them before building the jmods, or rebuild them again later on after signing.

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

I have a bit of a crazy idea, but I tested it and seemed to work fine.

In the sign.sh script, we extract the archive and sign all encountered dylib files.
It will only find dylib's inside the archive, not any dylib's that are contained in a jmod.

To check if the archive contains all signed dylib's in the /Contents/Home/lib directory that are also contained in the various jmod files, I extracted all files from all jmods and compared the list. They are identical as far as I could see.

Now my idea is to regenerate the jmod's by replacing the unsigned dylibs with the signed version.

The standard jmod tool does not support that, but I had the idea to use proguard as it can read / write jmods.

With a configuration like that (name replace.pro), I could replace any dylib in a jmod with the signed version:

-injars     signed(**.dylib)
-injars     jdk.jdwp.agent.jmod
-outjars    jdk.jdwp.agent.signed.jmod

-dontobfuscate
-dontshrink
-dontoptimize

-ignorewarnings
-dontwarn

and then run

/home/tn/bin/proguard-7.4.0-beta02/bin/proguard.sh @replace.pro

That replaces the dylib' contained in a single jmod. One would dynamically create such a config file for all jmod files.

I use that beta version of proguard as this is the first to add support for JDK 21.
Before that I copy all signed dylibs into a directory signed to make sure they are in the same directory structure as in the ylib (in a lib directory). Then proguard will read the jmod and just write it as is to the output, but the signed dylibs will be read first, so they take precedence when writing the output.

@netomi
Copy link
Contributor

netomi commented Oct 10, 2023

One could also quite easily write something in java to replace a file inside a jmod to avoid using proguard. Was using this to illustrate that it would be possible imho.

@netomi
Copy link
Contributor

netomi commented Oct 11, 2023

hmm the jmods will need to be post-processed as the hashes change and the module-info.class inside them will not match anymore. Running jmod hash might help though.

@netomi
Copy link
Contributor

netomi commented Oct 11, 2023

I have worked on some bytecode manipulation library that would be able to do that:

  • read the jmod
  • replace the dylib with signed version
  • update hashes in all ModuleHashes attributes of all jmod

it would have to be smart to process all jmods in a directory in one go and determine dependencies between them as they depend on each other, and changing a jmod changes its hash ofc. But that could be doable.

Link to the library: https://github.com/TinyGearsOrg/bat

@andrew-m-leonard
Copy link
Contributor Author

I have worked on some bytecode manipulation library that would be able to do that:

* read the jmod

* replace the dylib with signed version

* update hashes in all ModuleHashes attributes of all jmod

it would have to be smart to process all jmods in a directory in one go and determine dependencies between them as they depend on each other, and changing a jmod changes its hash ofc. But that could be doable.

Link to the library: https://github.com/TinyGearsOrg/bat

So yes this is possible.
I am going to add some debugging to our current process, before trying to re-write the processing which would be risky at this stage.

@andrew-m-leonard
Copy link
Contributor Author

What is suspicious is, it seems the Mac x64 builds sign fine most of the time, it's only the Mac aarch64 that fail all the time...

@netomi
Copy link
Contributor

netomi commented Oct 12, 2023

Do you have a trace of a x64 build that is getting signed and notarized fine so I can check the notarization log?
Maybe we should check if the x64 build has also dylibs inside the jmods. I find it strange that these dylibs seem to be duplicated anyways (inside the jmod and in the dedicated directory exploded).

@andrew-m-leonard
Copy link
Contributor Author

Maybe we should check if the x64 build has also dylibs inside the jmods. I find it strange that these dylibs seem to be >duplicated anyways (inside the jmod and in the dedicated directory exploded).

So yes that's standard, openjdk has a utility called "jlink" for creating custom JREs which creates new bundles from the required jmods, and and dylib's in each

@netomi
Copy link
Contributor

netomi commented Oct 12, 2023

I cant access the notarization build to retrieve the uuid.

However, I downloaded the artifact that succeeded, extracted all files from the jmods and compared them to the dylib's in the Contents/Home/lib folder and the files are identical.

This is different to the other build that failed, where the jmods contained slightly different versions of the same dylibs (apparently signed vs unsigned).

@andrew-m-leonard
Copy link
Contributor Author

This is different to the other build that failed, where the jmods contained slightly different versions of the same dylibs (apparently signed vs unsigned).
yes, agree that's what I found with the bad build
The logic should be no different between x64 and aarch64,... so that's a bit puzzling! I'm running a build with extra debug here: https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk11u/job/jdk11u-mac-aarch64-temurin/247/console

@netomi
Copy link
Contributor

netomi commented Oct 12, 2023

the aarch64 build has

14:08:38 BUILD_CONFIG[MAKE_EXPLODED]="true"

while the x86 has

14:06:28 BUILD_CONFIG[MAKE_EXPLODED]="false"

that seems to change the build quite a lot from the logs.

@andrew-m-leonard
Copy link
Contributor Author

the aarch64 build has

14:08:38 BUILD_CONFIG[MAKE_EXPLODED]="true"

while the x86 has

14:06:28 BUILD_CONFIG[MAKE_EXPLODED]="false"

that seems to change the build quite a lot from the logs.

You're probably looking at the 2nd build within the log, if you do a find of the first instance of MAKE_EXPLODED in both they will be "true"

@andrew-m-leonard
Copy link
Contributor Author

I think this is the problem, as part of the 2nd build we are seeing :

14:27:11  /Users/jenkins/workspace/build-scripts/jobs/jdk11u/jdk11u-mac-aarch64-temurin/workspace/build/src/build/macosx-aarch64-normal-server-release/support/modules_libs/java.base/libnio.dylib: replacing existing signature

This did not used to occur.

@netomi
Copy link
Contributor

netomi commented Oct 12, 2023

Could it be that aarch64 is built with a different Xcode (12.4) compared to x86 which has a different default settings to the code signing identity that is being used?

I can see the following code in mac.sh

# The configure option '--with-macosx-codesign-identity' is supported in JDK8 OpenJ9 and JDK11 and JDK14+
if [[ ( "$JAVA_FEATURE_VERSION" -eq 11 ) || ( "$JAVA_FEATURE_VERSION" -ge 14 ) ]]
then
  export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"
  ## Login to KeyChain
  ## shellcheck disable=SC2046
  ## shellcheck disable=SC2006
  #security unlock-keychain -p `cat ~/.password` login.keychain-db
  #rm -rf codesign-test && touch codesign-test
  #codesign --sign "Developer ID Application: London Jamocha Community CIC" codesign-test
  #codesign -dvvv codesign-test
  #export BUILD_ARGS="${BUILD_ARGS} --codesign-identity 'Developer ID Application: London Jamocha Community CIC'"
fi

to explicitly set a code sign identity in some cases. Maybe with older XCode versions the default was to not touch signatures, but with XCode 12.4 it overwrites them or removes them when no identity is set.

Btw. I also checked older builds of aarch64 and the same message was there, it was probably not noticed as the previous notarization did not care.

@andrew-m-leonard
Copy link
Contributor Author

Edit: the signing of all JMOD files for a build takes around 1 min, so probably is not worth looking into making this parallel.

The point on "concurrent" codesigning from within the build, is due to the openjdk build being concurrent, typically 8 concurrent make jobs on our Mac nodes.

@andrew-m-leonard
Copy link
Contributor Author

To prevent the unnecessary debug codesigning, we'd need to specify the --without-macosx-codesign configure arg.

@netomi
Copy link
Contributor

netomi commented Oct 16, 2023

Makes sense, I will look into signing jmod's post build. That is a topic that I have some experience with as I have worked on byte code processing which will be required to do as the module-info.class files inside the jmods contains the hashes of referenced module that will need to be updated accordingly.

The jmod tool does not seem to support updating a jmod file, but you will have to update them taking into account cross-references between them which will require analysing the module contents anyways (module requires).

Having a common way to do that signing for Windows / Macos is certainly a convincing argument.

@netomi
Copy link
Contributor

netomi commented Oct 16, 2023

actually the jmod tool should support updating the hashes for all jmods taking dependencies into account. However, I tried used the way as described in the doc by running it in the jmod directory:

jmod hash -module-path . --hash-modules .* 
Error: Is a directory
java.io.IOException: Is a directory
	at java.base/sun.nio.ch.UnixFileDispatcherImpl.read0(Native Method)
	at java.base/sun.nio.ch.UnixFileDispatcherImpl.read(UnixFileDispatcherImpl.java:51)
	at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:340)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:306)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:283)
	at java.base/sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:234)
	at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:74)
	at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
	at java.base/sun.nio.ch.ChannelInputStream.readNBytes(ChannelInputStream.java:176)
	at java.base/jdk.internal.jmod.JmodFile.checkMagic(JmodFile.java:56)
	at java.base/jdk.internal.jmod.JmodFile.<init>(JmodFile.java:180)
	at jdk.jlink/jdk.tools.jmod.JmodTask.hashModules(JmodTask.java:278)
	at jdk.jlink/jdk.tools.jmod.JmodTask.run(JmodTask.java:210)
	at jdk.jlink/jdk.tools.jmod.Main.main(Main.java:35)

tested that with different distributions and versions, always resulting in the same output.

Testing with sdk use java 11.0.18-tem seems to go further but fails to read the class files as they have been from the jdk 21 build ofc.

@andrew-m-leonard
Copy link
Contributor Author

It is just java.base that needs re-hashing, eg: https://github.com/openjdk/jdk21u/blob/65941f8d31094511a5bf8dff110645f83cfc07ef/make/CreateJmods.gmk#L156
ie.

jmod hash --module-path <jmod dir> --hash-modules '^(?!java.compiler$|jdk.internal.vm.compiler$|jdk.internal.vm.compiler.management$))'

@andrew-m-leonard
Copy link
Contributor Author

@netomi hmm, i'm a bit wary of "reproducibility" here in our re-construction of the JMOD, and we might introduce a regression if we don't re-create with jmod as per the build did.....
I'm wondering maybe the "during build" approach might be better...?
but we'd need to either use the "codesign" wrapper approach, but how would we do Windows?
We could do an Adoptium "patch" to add a "hook" into the CreateJmods.gmk ?

Thoughts?

@netomi
Copy link
Contributor

netomi commented Oct 16, 2023

Yeah that was also my thinking about supporting the in-build for windows, but that would mean that you would have to support a patch. Not sure how this would work in case of temurin, but maybe its already done like that in other cases.

I am testing out the updating of the jmod and re-hashing it so you can take a look how this would look like. I got the jmod command now working with your input, ty.

@netomi
Copy link
Contributor

netomi commented Oct 16, 2023

I worked on a script that can be used for testing purposes. If executed inside the respective jmods directory, it will analyse all jmods and replace all encountered dynamic library and executables with the version that is located outside (usually in the ../lib folder but can also be the ../bin folder for window builds).

The script has been tested for linux (not that it makes sense there, just for making sure it would also work there), mac and windows.

replace-signed-files-within-jmods.zip

Edit: updated the script to only write the jmod if it has been updated.

@netomi
Copy link
Contributor

netomi commented Oct 16, 2023

Output of the script for a macosx build is something like that:

tn@proteus:~/workspace/tinygears/tmp/temurin/mac/jdk-21+35/Contents/Home/jmods$ ./replace-signed-files-within-jmods.sh 
Processing JMOD file 'java.base.jmod'
  replacing dynamic library 'lib/libjava.dylib' ...
  replacing dynamic library 'lib/libjimage.dylib' ...
  replacing dynamic library 'lib/libjli.dylib' ...
  replacing dynamic library 'lib/libjsig.dylib' ...
  replacing dynamic library 'lib/libnet.dylib' ...
  replacing dynamic library 'lib/libnio.dylib' ...
  replacing dynamic library 'lib/libosxsecurity.dylib' ...
  replacing dynamic library 'lib/libsyslookup.dylib' ...
  replacing dynamic library 'lib/libverify.dylib' ...
  replacing dynamic library 'lib/libzip.dylib' ...
  replacing dynamic library 'lib/server/libjsig.dylib' ...
  replacing dynamic library 'lib/server/libjvm.dylib' ...
Writing JMOD file java.base.jmod due to updated files
Processing JMOD file 'java.compiler.jmod'
Processing JMOD file 'java.datatransfer.jmod'
...
Updating module hashes...
Hashes are recorded in module java.base
Done updating all jmods.

@andrew-m-leonard
Copy link
Contributor Author

Output of the script for a macosx build is something like that:

tn@proteus:~/workspace/tinygears/tmp/temurin/mac/jdk-21+35/Contents/Home/jmods$ ./replace-signed-files-within-jmods.sh 
Processing JMOD file 'java.base.jmod'
  replacing dynamic library 'lib/libjava.dylib' ...
  replacing dynamic library 'lib/libjimage.dylib' ...
  replacing dynamic library 'lib/libjli.dylib' ...
  replacing dynamic library 'lib/libjsig.dylib' ...
  replacing dynamic library 'lib/libnet.dylib' ...
  replacing dynamic library 'lib/libnio.dylib' ...
  replacing dynamic library 'lib/libosxsecurity.dylib' ...
  replacing dynamic library 'lib/libsyslookup.dylib' ...
  replacing dynamic library 'lib/libverify.dylib' ...
  replacing dynamic library 'lib/libzip.dylib' ...
  replacing dynamic library 'lib/server/libjsig.dylib' ...
  replacing dynamic library 'lib/server/libjvm.dylib' ...
Writing JMOD file java.base.jmod due to updated files
Processing JMOD file 'java.compiler.jmod'
Processing JMOD file 'java.datatransfer.jmod'
...
Updating module hashes...
Hashes are recorded in module java.base
Done updating all jmods.

Looks good
I'll give it a go, and see how it compares on a reproducible comparison

The other thing i'm going to try is see if we can "fix" the dual pass build issue, as I don't quite see why the need for make -t .. As I can't see why in theory you can't do the exploded make, sign "just" the dylib's, ensure "just" the dylib's timestamps are correct, and then make images. I don't see why gmake should need to rebuild the dylib's, as their dependent recipe targets won't have changed...I am suspecting it maybe because we "stash" the whole support directory, losing timestamp info maybe....
I will try some local tests, to gather some ideas.

@andrew-m-leonard
Copy link
Contributor Author

It's possible this condition dependent on gmake version >= 4.0 maybe related to why it functions differently
https://github.com/openjdk/jdk21u/blob/8047100e66f8cbe671de68ecbf672aceb5a444c8/make/common/MakeBase.gmk#L70

@andrew-m-leonard
Copy link
Contributor Author

@netomi I ran a little test with your script and from the reproducible build perspective it was fine. However, i'm rather nervous on assuming the jmod archive is "zip" format. It is currently due to the Java implementation of Jmod, but that can't be guaranteed, we really should use jmod extract, jmod create,... However, we would need to ensure using jmod with specify the correct extra parameters for each jmod (eg.--class-path, --man-pages, ...)

I did some tests without the make -t, and trying to stash differently, but it does seem make triggers a dylib re-build. I don't like the way we currently relying on that not happening.

@netomi
Copy link
Contributor

netomi commented Oct 17, 2023

My understanding is that the jmod is specified like that, however I understand your concern. All tools I know of that work with jmod do more or less the same, skip the first 4 bytes and then read a zip archive. This is a quick and dirty way to being able to update files inside the jmods for quick evaluation if this would be a viable way to go.

Using jmod extract / create would be the best way to do it, need to fiddle around with it to get it working though. Initially I was concerned whether I have all knowledge of the parameters that jmod create might expect for creating specific jmods, but need to test this out.

Edit: I remember in some older version of the relevant JEP it was mentioned that the content is basically a zip archive apart from the first 4 bytes. In the latest version I cant find any reference to it anymore: https://openjdk.org/jeps/261

So yeah, to be future-proof we should use the jmod tool itself to update files.

@netomi
Copy link
Contributor

netomi commented Oct 17, 2023

I did some tests without the make -t, and trying to stash differently, but it does seem make triggers a dylib re-build. I don't like the way we currently relying on that not happening.

what targets do you use for the second build? Maybe building with trace enable allows to identify why the dylibs are being rebuilt.

@andrew-m-leonard
Copy link
Contributor Author

I did some tests without the make -t, and trying to stash differently, but it does seem make triggers a dylib re-build. I don't like the way we currently relying on that not happening.

what targets do you use for the second build? Maybe building with trace enable allows to identify why the dylibs are being rebuilt.

Yeah I tried that and generated a 0.5Gb console file :-)
I didn't managed to fully analyse it, but I think some of the make rules actually force touch things..

@netomi
Copy link
Contributor

netomi commented Oct 18, 2023

so I managed to re-create a jmod after extracting it with this command:

jmod create --module-path .. --class-path classes/ --cmds bin/ --legal-notices legal/ --libs lib/ --man-pages man/ --compress zip-9 module.jmod 

the only difference was in the module-info.class file, but it is just the order of the attributes (I verified with my dump tool):

image
image

its a bit annoying to have to specify all different options for all possible content of a jmod file, but the module-target was not needed (in fact if you specify it, the jmod tool will add an additional ModuleTarget attribute to the existing one)

@netomi
Copy link
Contributor

netomi commented Oct 19, 2023

So thinking about the way we would update the jmod file, I think treating it as an archive and updating specific files is a more fail-safe method imho. If the jmod format changes, you would immediately know that it does not work anymore, the build fails and you would have to adapt. With the jmod create approach, if something changes wrt the content of a jmod, e.g. a new type of content is added, you would not notice a failure during the build, it would just be missing in the re-generated jmod.

@andrew-m-leonard
Copy link
Contributor Author

The other approach i'm thinking about is doing a new upstream contribution, to add a new openjdk configure option, something like: --with-signtool=<Path to custom signtool>. Which would then get invoked during the make process like the adhoc codesign is at the moment.
We may be able to do that as an Adoptium "patch" until it is upstream'd and backported.

@netomi
Copy link
Contributor

netomi commented Oct 19, 2023

I did not think about that, but I guess thats the way it should work. The downside of that approach would be that you would have to support older jdks in a different way as the one where this is integrated, but that would be acceptable imho.

Edit: would be happy to help on that contribution.

@sxa
Copy link
Member

sxa commented Dec 13, 2023

@andrew-m-leonard @netomi Is this still a problem, and do we need to move forward on a fix before the January release? There's a lot of stuff in this issue and I haven't digested all of it so it would be good to understand the current status of this and decide on a plan.

@netomi
Copy link
Contributor

netomi commented Dec 13, 2023

The problem was triggered by a more recent version of gmake that highlighted some fundamental problem with the way the signing is happening. For the time being this seems to be resolved by reverting to an older version of gmake, but in the long term this will need to be addressed imho.

@andrew-m-leonard
Copy link
Contributor Author

@netomi So your summary is correct, for the short term the make version resolves, but ideally coming up with a better method would be advtangeous. However, I would not say it's a priority currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aarch Issues that affect or relate to the aarch ARCHITECTURE arm Issues that affect or relate to the ARM OS installer Issues that relate to our installer jobs or installer repo macos Issues that affect or relate to the MAC OS
Projects
Status: Todo
Development

No branches or pull requests

4 participants