SMAppService: registerAndReturnError fails with Codesigning failure loading plist code: -67054

When registering the LaunchDaemons of the application using SMAppService:registerAndReturnError, I am seeing the below error.

The operation couldn’t be completed. Codesigning failure loading plist: <plist name> code: -67054

Above issue is seen only on Ventura 13.0.1 and Ventura 13.1 versions. It is working fine on Ventura 13.5, Ventura 13.6 and Sonoma 14.2 as well.

When I checked the system logs using

sudo log stream --debug --info --predicate "process in { '<my process>', 'smd', 'backgroundtaskmanagementd'} and sender in {'ServiceManagement', 'BackgroundTaskManagement', 'smd', 'backgroundtaskmanagementd'}"

I see below error

2024-02-27 16:02:22.382487+0530 0x4c006    Error       0x0                  321    0    smd: [com.apple.libxpc.SMAppServiceShared:all] Static code signature check failed: -67054
2024-02-27 16:02:22.382500+0530 0x4c006    Error       0x0                  321    0    smd: [com.apple.libxpc.SMAppServiceShared:all] Unable to validate code signature on bundle for <private>. Code: -67054
2024-02-27 16:02:22.384288+0530 0x4c006    Error       0x0                  321    0    smd: [com.apple.xpc.smd:SMAppServiceFactory] Unable to load plist: <private> subpath: <private> status: -67054

There is no difference in the code between. There is no modification to the application bundle after codesigning in both cases (working and not working). Can someone let me know why is there a difference in the behavior in the earlier Ventura versions? Any steps to debug and resolve this issue would be highly appreciated.

Thanks

Replies

Error -67054 is errSecCSBadResource.

Given that this is only failing on early versions of macOS 13, this is likely a bug )-:

My recommendation is to not support older versions of major macOS releases. That is, if you support macOS 13, only support macOS 13.6.x. Any machine that can run macOS 13 can upgrade to 13.6, and that upgrade includes additional benefits, like important security fixes. By supporting macOS 13.0 you’re encouraging your users to stay on an older, less secure system.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"