Microsoft MVP성태의 닷넷 이야기
오류 유형: 311. certutil 실행 오류 - 0x80070057 [링크 복사], [링크+제목 복사]
조회: 16523
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

certutil 실행 오류 - 0x80070057

아래의 문서에 보면,

Windows Enforcement of Authenticode Code Signing and Timestamping
; http://social.technet.microsoft.com/wiki/contents/articles/32288.windows-enforcement-of-authenticode-code-signing-and-timestamping.aspx

certuilt.exe를 실행하는 예제가 나옵니다. 그런데 실제로 그렇게 실행했더니 다음과 같이 ERROR_INVALID_PARAMETER 오류가 발생합니다.

C:\Windows\system32>certutil -setreg chain\Default\WeakSha1ThirdPartyAfterTime @01/01/2015
HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\OID\EncodingType 0\CertDllCreateCertificateChainEngine\Config\Default:
CertUtil: -setreg command FAILED: 0x80070057 (WIN32: 87 ERROR_INVALID_PARAMETER)
CertUtil: The parameter is incorrect.

왜냐하면, 이는 날짜 표기에 따른 차이때문입니다. 일단, 해당 명령을 실행할 운영체제의 날짜 표기 방법을 다음과 같이 date 명령어로 파악해서,

C:\Windows\system32>date
The current date is: 2015-11-13
Enter the new date: (yy-mm-dd)

이에 따라 "년-월-일" 순으로 다음과 같이 명령을 내려주면 됩니다. ^^

C:\Windows\system32>certutil -setreg chain\Default\WeakSha1ThirdPartyAfterTime @2015/01/01
HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\OID\EncodingType 0\CertDllCreateCertificateChainEngine\Config\Default:

New Value:
  WeakSha1ThirdPartyAfterTime REG_BINARY = 2015-01-01 오전 12:00
CertUtil: -setreg command completed successfully.
The CertSvc service may need to be restarted for changes to take effect.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 11/23/2015]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 



2020-08-31 02시22분
Certulitis - one tool that keeps on giving
; https://www.hexacorn.com/blog/2020/08/30/certulitis-one-tool-that-keeps-on-giving/

set CERTSRV_LOGFILE=c:\test\foo.log
set CERTSRV_DEBUG=0xFFFFFFFF

---------------------------------------------

openssl 3.0으로 만든 pfx의 -dump 출력 예제

c:\temp> certutil -dump -v d:\Settings\test_cert\win2008r2.pfx
Enter PFX password:
================ Certificate 0 ================
================ Begin Nesting Level 1 ================
Element 0:
X509 Certificate:
Version: 3
Serial Number: 3b345d76857a6d58c85d469dd2eb3e0e432a14ab
Signature Algorithm:
    Algorithm ObjectId: 1.2.840.113549.1.1.11 sha256RSA
    Algorithm Parameters:
    05 00
Issuer:
    CN=win2008r2
    O=Internet Widgits Pty Ltd
    S=Some-State
    C=AU
  Name Hash(sha1): 214111180f411526bf9668801e56fa6eeb04c174
  Name Hash(md5): e59d79b9526cc644c7a3ab58b9d8f327

 NotBefore: 2013-06-09 오후 12:03
 NotAfter: 2013-06-06 오후 12:03

Subject:
    CN=win2008r2
  Name Hash(sha1): 6389965a435cf7dcafbfc11b914909ef7ca955a4
  Name Hash(md5): 8ed715e917a11604e84557f076cf1e64

Public Key Algorithm:
    Algorithm ObjectId: 1.2.840.113549.1.1.1 RSA (RSA_SIGN)
    Algorithm Parameters:
    05 00
Public Key Length: 2048 bits
Public Key: UnusedBits = 0
    0000 30 82 01 0a 02 82 01 01 00 94 57 77 b3 86 e2 81
    0010 cb 26 ab fa 89 3b 6f 14 0c 13 e3 8a df 03 5b ea
    0020 e0 85 e2 16 9f 50 78 f9 11 77 5f f9 ff 85 a6 b8
    0030 57 47 ba f6 29 ea e2 d6 95 54 3b 52 6c 1e 54 34
    0040 d4 38 c1 f4 cf 81 d5 a7 87 84 ca 37 da 13 a4 8a
    0050 9c da 4f e8 9d 70 af 02 72 e0 84 d3 35 ee 83 e3
    0060 42 ab d0 e9 78 9e 1f 0b 6b d4 d8 9e 71 7c 87 c8
    0070 dd c7 06 e3 72 ba 12 6a c6 87 9a f6 93 3b b8 71
    0080 5f 95 43 db 5b e1 2d 65 3d c0 fa 8f a0 3e be 78
    0090 0c 50 95 56 01 80 89 dd ee ff 4a 16 34 77 4e 8d
    00a0 ee 62 9e 5e 30 30 dd 4e 32 9f 36 e3 6b 55 2c c8
    00b0 2e fe 4c 8a f5 74 1a 9c 22 21 67 74 30 7d dc 7a
    00c0 dd 19 8e b5 cf 77 ca 98 c0 ab f8 c6 72 e4 ed cb
    00d0 a6 1f 23 b9 9e 2c 1d d0 6f fd 0d b3 c9 d2 b0 52
    00e0 88 a1 3e 27 33 21 06 73 36 25 de 77 9d 7e a6 f1
    00f0 d0 95 f9 6e 13 4c f6 19 f9 7d 87 d5 f0 17 ae cf
    0100 83 1f d6 e4 f1 85 29 58 55 02 03 01 00 01
Certificate Extensions: 3
    2.5.29.17: Flags = 0, Length = d
    Subject Alternative Name
        DNS Name=win2008r2

    2.5.29.14: Flags = 0, Length = 16
    Subject Key Identifier
        c95b737ed76db5759f5ff808bae3d64e3b2d3268

    2.5.29.35: Flags = 0, Length = 18
    Authority Key Identifier
        KeyID=509d24f35e28d103c67cb63fcf37b5564ef9e0cb

Signature Algorithm:
    Algorithm ObjectId: 1.2.840.113549.1.1.11 sha256RSA
    Algorithm Parameters:
    05 00
Signature: UnusedBits=0
    0000 b1 4f 8f 61 0c cc 80 e7 4d c5 0e ae a4 65 da 05
    0010 aa 0e 44 84 ab 2e 22 82 cb 17 95 42 f2 7f fa d6
    0020 e7 b1 a8 34 9f c4 f4 38 65 c5 45 39 3f 18 38 83
    0030 8d a4 c7 5c 7b e4 9f 2b c0 2a 6a d5 be 32 45 92
    0040 8e b2 79 fc d7 b9 4f 16 a7 11 90 7a d1 8a ab 4c
    0050 de b2 b0 6e aa e1 25 ed 97 cb d1 45 68 85 d8 d5
    0060 e3 71 ad 75 a4 4f 76 2e d3 c3 1f ff aa f0 1a 59
    0070 c1 5c 0f 3c da be df f2 9b 81 f2 e1 1a 56 4c 70
    0080 aa 9b c9 ae 60 2c 57 f3 d2 9e 99 cc 69 6d ec 61
    0090 00 72 c4 62 85 0a 02 e5 23 1b d2 e3 b4 13 3d 8c
    00a0 96 49 ff bc 21 94 a6 3e 27 e5 9b 8a e5 fc db 1d
    00b0 db c5 54 1f f0 b1 cc da 01 5f 9d 8c d2 78 c5 df
    00c0 db 80 6b 51 ab 32 85 9f 95 25 c9 7c 41 08 9d e1
    00d0 30 6c ea a0 ad 96 bb 5a 9e e7 38 c4 30 26 a0 d0
    00e0 e6 e5 45 fc 30 d5 8c f9 7c 76 99 56 0d a6 30 b4
    00f0 06 80 70 19 1b 58 2c fd 59 e5 0a 31 65 0f e8 0c
Non-root Certificate
Key Id Hash(rfc-sha1): c95b737ed76db5759f5ff808bae3d64e3b2d3268
Key Id Hash(sha1): 4a7dd11cc60fc83c61cea78a4d54ca8359b2058a
Key Id Hash(bcrypt-sha1): 7dc133f69235b563d3805a7f4e2d0a7471732708
Key Id Hash(bcrypt-sha256): 10d8ed9c32ff2e0fd3f634ccc26c0314078e3f7aac5476bd0602bd2f3dfba249
Key Id Hash(md5): fdb5af2414f648270fdb85950da4b53b
Key Id Hash(sha256): 5e4045360826722b02c777cb7d05b7c43e07546c0eba5fdbdc28d986b6f14f63
Key Id Hash(pin-sha256): CumB32GxTzXY9zhxDEjyunyaqLkScBTMTFjZ2qrBvug=
Key Id Hash(pin-sha256-hex): 0ae981df61b14f35d8f738710c48f2ba7c9aa8b9127014cc4c58d9daaac1bee8
Cert Hash(md5): c15fbe1c21655759464ca1464b4d94d3
Cert Hash(sha1): f2f6e7b3779bf61f08a723114d05ac315aa78148
Cert Hash(sha256): a73e8a7c824f732833e60aa1b4f7dd25142807907f32d205c933690abd077877
Signature Hash: 767ec4baff549a741a675b7cfe630e99a21e31172336193ce2ca3a98fb7d01b6
---------------- End Nesting Level 1 ----------------

  CERT_KEY_IDENTIFIER_PROP_ID(20):
    c95b737ed76db5759f5ff808bae3d64e3b2d3268

  CERT_MD5_HASH_PROP_ID(4):
    c15fbe1c21655759464ca1464b4d94d3

  CERT_SHA1_HASH_PROP_ID(3):
    f2f6e7b3779bf61f08a723114d05ac315aa78148

  CERT_KEY_CONTEXT_PROP_ID(5):
    hCryptProv = 00000158B662A7A0
    KeySpec = 1 -- AT_KEYEXCHANGE

  CERT_ACCESS_STATE_PROP_ID(14):
  AccessState = 0

  Provider = Microsoft Enhanced Cryptographic Provider v1.0
  ProviderType = 1
  RSA
  PP_KEYSTORAGE = 1
    CRYPT_SEC_DESCR -- 1
  KP_PERMISSIONS = 3f (63)
    CRYPT_ENCRYPT -- 1
    CRYPT_DECRYPT -- 2
    CRYPT_EXPORT -- 4
    CRYPT_READ -- 8
    CRYPT_WRITE -- 10 (16)
    CRYPT_MAC -- 20 (32)

  ...[생략]...

    Allow Full Control NT AUTHORITY\SYSTEM
    Allow Full Control BUILTIN\Administrators
    Allow Full Control ...[생략]...


Private Key:
  PRIVATEKEYBLOB
  Version: 2
  aiKeyAlg: 0xa400
    CALG_RSA_KEYX
    Algorithm Class: 0xa000(5) ALG_CLASS_KEY_EXCHANGE
    Algorithm Type: 0x400(2) ALG_TYPE_RSA
    Algorithm Sub-id: 0x0(0) ALG_SID_RSA_ANY
  0000 52 53 41 32 RSA2
  0000 ...
  048c
Encryption test passed
CertUtil: -dump command completed successfully.
정성태

... [16]  17  18  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
13231정성태1/27/20233741오류 유형: 839. python - TypeError: '...' object is not callable
13230정성태1/26/20234107개발 환경 구성: 660. WSL 2 내부로부터 호스트 측의 네트워크로 UDP 데이터가 1개의 패킷으로만 제한되는 문제
13229정성태1/25/20235103.NET Framework: 2090. C# - UDP Datagram의 최대 크기
13228정성태1/24/20235231.NET Framework: 2089. C# - WMI 논리 디스크가 속한 물리 디스크의 정보를 얻는 방법 [2]파일 다운로드1
13227정성태1/23/20234930개발 환경 구성: 659. Windows - IP MTU 값을 바꿀 수 있을까요? [1]
13226정성태1/23/20234602.NET Framework: 2088. .NET 5부터 지원하는 GetRawSocketOption 사용 시 주의할 점
13225정성태1/21/20233849개발 환경 구성: 658. Windows에서 실행 중인 소켓 서버를 다른 PC 또는 WSL에서 접속할 수 없는 경우
13224정성태1/21/20234207Windows: 221. Windows - Private/Public/Domain이 아닌 네트워크 어댑터 단위로 방화벽을 on/off하는 방법
13223정성태1/20/20234409오류 유형: 838. RDP 연결 오류 - The two computers couldn't connect in the amount of time allotted
13222정성태1/20/20234095개발 환경 구성: 657. WSL - DockerDesktop.vhdx 파일 위치를 옮기는 방법
13221정성태1/19/20234322Linux: 57. C# - 리눅스 프로세스 메모리 정보파일 다운로드1
13220정성태1/19/20234437오류 유형: 837. NETSDK1045 The current .NET SDK does not support targeting .NET ...
13219정성태1/18/20234009Windows: 220. 네트워크의 인터넷 접속 가능 여부에 대한 판단 기준
13218정성태1/17/20233945VS.NET IDE: 178. Visual Studio 17.5 (Preview 2) - 포트 터널링을 이용한 웹 응용 프로그램의 외부 접근 허용
13217정성태1/13/20234527디버깅 기술: 185. windbg - 64비트 운영체제에서 작업 관리자로 뜬 32비트 프로세스의 덤프를 sos로 디버깅하는 방법
13216정성태1/12/20234780디버깅 기술: 184. windbg - 32비트 프로세스의 메모리 덤프인 경우 !peb 명령어로 나타나지 않는 환경 변수
13215정성태1/11/20236347Linux: 56. 리눅스 - /proc/pid/stat 정보를 이용해 프로세스의 CPU 사용량 구하는 방법 [1]
13214정성태1/10/20235882.NET Framework: 2087. .NET 6부터 SourceGenerator와 통합된 System.Text.Json [1]파일 다운로드1
13213정성태1/9/20235428오류 유형: 836. docker 이미지 빌드 시 "RUN apt install ..." 명령어가 실패하는 이유
13212정성태1/8/20235177기타: 85. 단정도/배정도 부동 소수점의 정밀도(Precision)에 따른 형변환 손실
13211정성태1/6/20235206웹: 42. (https가 아닌) http 다운로드를 막는 웹 브라우저
13210정성태1/5/20234299Windows: 219. 윈도우 x64의 경우 0x00000000`7ffe0000 아래의 주소는 왜 사용하지 않을까요?
13209정성태1/4/20234201Windows: 218. 왜 윈도우에서 가상 메모리 공간은 64KB 정렬이 된 걸까요?
13208정성태1/3/20234181.NET Framework: 2086. C# - Windows 운영체제의 2MB Large 페이지 크기 할당 방법파일 다운로드1
13207정성태12/26/20224445.NET Framework: 2085. C# - gpedit.msc의 "User Rights Assignment" 특권을 코드로 설정/해제하는 방법파일 다운로드1
13206정성태12/24/20224683.NET Framework: 2084. C# - GetTokenInformation으로 사용자 SID(Security identifiers) 구하는 방법 [3]파일 다운로드1
... [16]  17  18  19  20  21  22  23  24  25  26  27  28  29  30  ...