2014-10-31 16 views
9

Ich hatte eine Code-Signatur auf Kext in Yosemite. Aber Kextload ist fehlgeschlagen.
Es war Version2 Codesign. codesign --verify ist wahr.
Aber Kextload ist fehlgeschlagen. Warum nicht in Yosemite laden?codesigned kext Aber warum nicht laden in Yosemite (10.10)

Hier ist mein Protokoll.

Ich habe mit codesign -dvvv ./myKext.kext überprüft und es ist alles in Ordnung.

codesign -dvvv ./myKext.kext folgende zurückgegeben:

Executable=/Path/to/myKext 
Identifier=com.myKext.kext.Firewall 
Format=bundle with Mach-O thin (x86_64) 
CodeDirectory v=20100 size=317 flags=0x0(none) hashes=9+3 location=embedded 
Hash type=sha1 size=20 
CDHash=d0ff68bd8b49c650f45349c2d1570d45a8c1f148 
Signature size=8544 
Authority=Developer ID Application: My Kext Co., Ltd. (R2PBZJ465V) 
Authority=Developer ID Certification Authority 
Authority=Apple Root CA 
Timestamp=2014. 10. 31. 오전 11:09:35 
Info.plist entries=18 
TeamIdentifier=not set 
Sealed Resources version=2 rules=12 files=1 
Internal requirements count=1 size=188 

Es zeigt, dass die Version 2.
Aber sudo kextload ./myKext.kext kehrt die folgenden:

/Path/to/myKext.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).

cat /var/log/system.log kehrt:

com.apple.kextd[19]: ERROR: invalid signature for com.myKext.kext.Firewall, will not load

sudo kextutil -l ./myKext.kext kehrt:

Diagnostics for ./myKext.kext: 
Code Signing Failure: code signature is invalid 
ERROR: invalid signature for com.myKext.kext.Firewall, will not load 

Warum sind ungültige Signatur ?!
Ich habe mit Version2-Codesign in Yosemite unterzeichnet.
Was habe ich falsches Zeichen gemacht? Jemand bringt mir bitte bei.

+0

Ich rate nur, aber wird Apple nicht in die Code-Signierung einbezogen werden müssen, um es gültig zu machen? – trojanfoe

+0

Haben Sie von Apple angefordert, dass Ihre DeveloperID das Attribut "kext codesign" hinzugefügt hat? – TheDarkKnight

+0

Das sieht wie das gleiche Problem aus: http://stackoverflow.com/questions/26283158/codesigning-kext-with-kext-enabled-certificate-fails-during-kextload-code-sign – pmdj

Antwort

8

Ich hatte das gleiche Problem auch. Und ich habe die Lösung mit Ihnen geteilt.

Apple hat das Mac Developer Program geändert und die Zertifizierung für Kext entfernt. Selbst wenn Sie Mitglied des Mac Developer Program sind, erhalten Sie keine Zertifizierung für die Kext-Entwicklung, es sei denn, Sie fordern sie unter Developer ID and Gatekeeper an. BTW

, sagen Äpfel,

"KEXT signing is intended for signing commercially shipping kexts or projects broadly distributed in a large organization."

Also, was können wir tun, um unsere Kext auf der von KEXT Development Mode ausgeführt wird Hinzufügen der "kext-dev- mode = 1" boot-arg. Wie,

sudo nvram boot-args="debug=0x146 kext-dev-mode=1" 

Und neu starten.

Ich wünsche, dass dies für Sie hilfreich sein wird.

+0

Diese Antwort ist veraltet ab El Capitan (10.11). Siehe andere Antworten für Details. –

0

Ich stimme mit ParaDevil Antwort.
Für OS X Yosemite Sie folgendes tun:

  1. Download "Kernel Debug Kit";
  2. Installationspaket ausführen;
  3. Weiter mit Schritt "Lies mich";
  4. "Bitte lesen", sagt:

In order to load unsigned kexts, the system must have "KEXT Developer Mode" enabled by adding the "kext-dev-mode=1" boot-arg. The following command (followed by a reboot) would be suitable to prepare a system for testing non-production kexts:     

sudo nvram boot-args="debug=0x146 kext-dev-mode=1" 

Once this is done, the machine will be able to load any valid kext; signatures will still be checked, but a failed verification will just result in a log message. Note: This applies to kexts that contain a binary, as well as codeless (plist-only) kexts. The system will remain in developer mode until you manually remove the boot-arg or clear nvram and reboot. You can exit developer mode by redefining the boot-arg to your previous settings, or clear your boot-args as follows:

sudo nvram -d boot-args 

Apple recommends that you make use of KEXT Developer Mode rather than use your Developer ID certificate to sign drivers while they are under development. Ideally you should sign a driver using a Developer ID certificate only when it reaches its final stages of testing and is being evaluated for release to customers.


Für OS X El Kapitän 10.11 Befehl:

sudo nvram boot-args="debug=0x146 kext-dev-mode=1" 

hat keine Wirkung.

Lesen Sie System Integrity Protection Guide/Kernel Extensions für weitere Informationen.

0

Ab Dezember 2016:

Dies ist aufgrund der System Integrity Protection-Funktion, die in El Capitan (10.11) eingeführt wurde. Ab El Capitan hat die boost-Option kext-dev-mode keine Wirkung, daher funktioniert die Antwort von ParaDevil nicht.

  1. Boot to Recovery-OS durch einen Neustart Ihrer Maschine und halten Sie die Befehls- und R-Tasten beim Start: Sie müssen stattdessen SIP indem Sie die Anweisungen von this page deaktivieren.

  2. Starten Sie das Terminal über das Menü Dienstprogramme.

  3. Führen Sie den folgenden Befehl ein:

    csrutil disable 
    

Beim Neustart sollten die Systemintegritätsschutz deaktiviert werden.