본문 바로가기
Development/Windows Driver

[Windows Driver] 드라이버 교차 인증 사인 방법 How to sign Windows Driver

by qWooWp 2023. 1. 12.
반응형

이 글의 목적 빌드된 Windows Printer Driver 를 Self Sign 하는 방법을 찾으며 정리한 글입니다. 

 

아래 내용 업데이트 (2023-01-16)

더이상 OV 인증서를 이용한 /ac 옵션을 사용한 Cross 인증을 허용하지 않는다는 업체의 답변을 받았습니다. 

EV 인증서를 받아서 Register HW Program 을 이용해야만 한다고 하는데요. 

다만 백그라운드에서는 이전에 받았던 인증서는 여전히 인증이 되고 있습니다. (어떻게 해야 되는지 혼돈만 가중되네요)

https://learn.microsoft.com/en-us/windows-hardware/drivers/install/kernel-mode-code-signing-policy--windows-vista-and-later-

 

Driver Signing Policy - Windows drivers

Driver Signing Policy

learn.microsoft.com

 


아래 글은 Microsoft 기술 문서를 참조하였습니다.

https://learn.microsoft.com/en-us/windows-hardware/drivers/install/driver-signing

 

Driver Sign 에는 2가지 방법이 존재 합니다. 다만 편리를 위해서 후자를 이용하는 방법에 대해 조사하였습니다.

  1. Certify your driver with Microsoft and Microsoft will provide a signature for it. When your driver package passes the certification tests, it can be signed by Windows Hardware Quality Labs (WHQL). If your driver package is signed by WHQL, it can be distributed through the Windows Update program or other Microsoft-supported distribution mechanisms.
  1. Vendors or driver developers can obtain a software publishing certificate (SPC) from a Microsoft authorized Certificate Authority (CA) and use it to sign kernel mode and user mode binaries by themselves.
  • The selfsign_readme.htm file in the Windows 7 WDK is located in the WDK install directory, \WinDDK\7600.16385.1\src\general\build\driversigning. This directory also has a command file, selfsign_example.cmd, which can be edited to run the driver signing commands. The selfsign_readme.htm file in the Windows 8.1 WDK is located at C:\Program Files (x86)\Windows Kits\8.1\bin\selfsign, and provides links to additional driver signing information.

SELF SIGN 하기위한 wdk 있는 자료를 압축하여 아래 첨부 하였습니다.

driversigning.zip
0.18MB

 

signtool sign 이라는 명령을 이용하여 인증을 수행하게 됩니다. 

 

TimeStamp 옵션

우선 TimeStamp 옵션을 사용하면 인증서의 유효기간은 상관 없이 인증 된 드라이버를 계속 사용할 수 있습니다. 

사용법

/tr http://sha256timestamp.ws.symantec.com/sha256/timestamp.dll  

 

교차 서명 방법 : Kernel mode Driver 의 경우 꼭 교차 서명 방법을 사용해야 합니다. 

/ac 인증서 

 

교차 인증에 대한 관련 문서 

https://learn.microsoft.com/ko-kr/windows-hardware/drivers/install/cross-certificates-for-kernel-mode-code-signing

 

커널 모드 코드 서명에 대한 인증서 간 - Windows drivers

이 정보는 Microsoft Windows 대한 코드 서명 커널 모드 이진 파일에 대해 인증서 간을 가져오고 사용하는 방법을 설명합니다.

learn.microsoft.com

 

1. console 에서 인증서 관리자를 실행합니다. 

> certlm 

 

2. 교차 인증서를 구하기 위해서  내가 발급받은 인증서에 대한 정보가 필요 합니다. 

 

3. 인증서 관리자에 왼쪽 트리에서

 

인증서 - 로컬 컴퓨터 >> 신뢰할 수 있는 게시자 >> 인증서 

를 선택합니다. 

 

4. 발급받은 인증서를 오른쪽버튼으로 클릭합니다. 

 

"인증 경로" 탭을 선택 합니다. 

 

6. 루트 인증서의 "자세히" 탭을 선택합니다. 

이 인증서의 발급자  지문 을 찾습니다.

 

 

위 파일을 이용하여 인증 시도를 하였지만 아래와 같이 오류가 발생하여 다시 검색..

 A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.

 

기본적으로 SPC 와 연관된 cross-certificate 를 사용해서 인증을 수행해야 합니다. 

 

관련 인증서 다운로드 위치 

https://www.websecurity.digicert.com/theme/roots

 

Licensing and Use of Root Certificates | DigiCert

All active roots on this page are covered in our Certification Practice Statement (CPS). Terms of Usage You may download, use and distribute the Root Certificates only under the terms of the Root Certificate License Agreement (PDF). There is no charge for

www.websecurity.digicert.com

 

 

반응형

댓글