Try emulating Mavericks' codesign --deep for earlier OS X versions.