Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing deletion of a certificate by its thumbprint. #46

Conversation

Nimesh-Msys
Copy link
Contributor

@Nimesh-Msys Nimesh-Msys commented Dec 28, 2018

  • Fix deletion of a certificate by its thumbprint.

  • Fetch correct certificate from the given store by its thumbprint.

  • Fixes: 576

Signed-off-by: Nimesh-Msys [email protected]

Description

Used CRYPT_HASH_BLOB structure which takes thumbprint as an input and using this struct with CertFindCertificateInStore. In this way we have tried to avoid the dependency of powershell command while deleting a certificate.

Check List

super(nil)
if str
# Converting the string to its byte array
arr = [str].pack("H*").unpack("C*")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can name variable itself to something byte_arr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have made the changes. Thanks

@Nimesh-Msys Nimesh-Msys force-pushed the Nimesh/MSYS-951_Fix_delete_by_thumbprint branch from 8b6f161 to a8c1a16 Compare December 31, 2018 16:14
@tas50
Copy link
Contributor

tas50 commented Dec 31, 2018

@Nimesh-Msys can you rebase this against master now that I merged in #45

- Using the thumbprint directly to fetch a certificate
- Using `CertFindCertificateInStore` with `CRYPT_HASH_BLOB` structure to achieve this.
- Minor cleanup and refactor.
- Minor update as per the review comment
- Consider `store_name` in powershell command while fetching certificate details by thumbprint

- Fixes MSYS-951 and MSYS-937

Signed-off-by: Nimesh-Msys <[email protected]>
@Nimesh-Msys Nimesh-Msys force-pushed the Nimesh/MSYS-951_Fix_delete_by_thumbprint branch from a8c1a16 to ad7e324 Compare January 2, 2019 06:14
@Nimesh-Msys
Copy link
Contributor Author

@Nimesh-Msys can you rebase this against master now that I merged in #45

Hey Tim, I've re based and updated this PR. Could you please take a look.
Thanks

@Vasu1105 Vasu1105 requested review from tas50 and btm January 3, 2019 11:43
@Vasu1105
Copy link

Vasu1105 commented Jan 3, 2019

LGTM.

@btm btm merged commit d333dba into chef:master Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants