Skip to content

Conversation

@p0dalirius
Copy link
Contributor

No description provided.

@p0dalirius p0dalirius self-assigned this Nov 6, 2025
@p0dalirius p0dalirius added the enhancement New feature or request label Nov 6, 2025
@p0dalirius p0dalirius requested a review from Copilot November 6, 2025 17:47
@p0dalirius p0dalirius merged commit f98207a into main Nov 6, 2025
9 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors cryptographic type naming conventions by adding underscores to separate words in RSA and ECC blob type names for improved consistency. The changes affect constants, struct types, function names, and documentation across the Windows CNG bcrypt keys package.

  • Renamed BCRYPT_RSAKEY_BLOB to BCRYPT_RSA_KEY_BLOB throughout the codebase
  • Renamed BCRYPT_ECCKEY_BLOB to BCRYPT_ECC_KEY_BLOB throughout the codebase
  • Renamed RSA blob types (public, private, full private) to include underscores
  • Updated all related test functions, error messages, and documentation

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
windows/cng/bcrypt/keys/types/blob_type.go Updated RSA blob type constant names to include underscores
windows/cng/bcrypt/keys/headers/BCRYPT_RSA_KEY_BLOB.go Renamed struct type and updated all methods, documentation, and error messages
windows/cng/bcrypt/keys/headers/BCRYPT_RSA_KEY_BLOB_test.go Updated test function names and type references
windows/cng/bcrypt/keys/headers/BCRYPT_ECC_KEY_BLOB.go Renamed struct type and updated all methods, documentation, and error messages
windows/cng/bcrypt/keys/headers/BCRYPT_ECC_KEY_BLOB_test.go Updated test function names and type references
windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PUBLIC_BLOB.go Renamed struct type and updated all methods, documentation, and error messages
windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PUBLIC_BLOB_test.go Updated test function names and type references
windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PRIVATE_BLOB.go Renamed struct type and updated all methods, documentation, and error messages
windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PRIVATE_BLOB_test.go Updated test function names and type references
windows/cng/bcrypt/keys/blob/BCRYPT_RSA_FULLPRIVATE_BLOB.go Renamed struct type and updated all methods, documentation, and error messages
windows/cng/bcrypt/keys/blob/BCRYPT_RSA_FULLPRIVATE_BLOB_test.go Added empty test file stub
windows/cng/bcrypt/keys/BCRYPT_RSA_PUBLIC_KEY.go Updated field types and documentation references
windows/cng/bcrypt/keys/BCRYPT_RSA_PRIVATE_KEY.go Updated field types and documentation references
windows/cng/bcrypt/keys/BCRYPT_DSA_PUBLIC_KEY.go Updated documentation references to use new RSA naming
windows/cng/bcrypt/keys/BCRYPT_DSA_PRIVATE_KEY.go Updated documentation references to use new RSA naming

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to 35
// The function expects the byte slice to follow the RSA public key format, starting with the BCRYPT_RSA_KEY_BLOB header.
// It extracts the public exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PUBLIC_KEY structure.
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The documentation incorrectly refers to 'RSA public key format' and 'BCRYPT_RSA_KEY_BLOB' for a DSA key function. This should reference 'DSA public key format' and 'BCRYPT_DSA_KEY_BLOB' instead.

Suggested change
// The function expects the byte slice to follow the RSA public key format, starting with the BCRYPT_RSA_KEY_BLOB header.
// It extracts the public exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PUBLIC_KEY structure.
// The function expects the byte slice to follow the DSA public key format, starting with the BCRYPT_DSA_KEY_BLOB header.
// It extracts the DSA parameters (such as p, q, g, and y) from the byte slice and stores them in the BCRYPT_DSA_PUBLIC_KEY structure.

Copilot uses AI. Check for mistakes.
Comment on lines +34 to 35
// The function expects the byte slice to follow the RSA PRIVATE key format, starting with the BCRYPT_RSA_KEY_BLOB header.
// It extracts the PRIVATE exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PRIVATE_KEY structure.
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The documentation incorrectly refers to 'RSA PRIVATE key format' and 'BCRYPT_RSA_KEY_BLOB' for a DSA key function. This should reference 'DSA PRIVATE key format' and 'BCRYPT_DSA_KEY_BLOB' instead.

Suggested change
// The function expects the byte slice to follow the RSA PRIVATE key format, starting with the BCRYPT_RSA_KEY_BLOB header.
// It extracts the PRIVATE exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PRIVATE_KEY structure.
// The function expects the byte slice to follow the DSA PRIVATE key format, starting with the BCRYPT_DSA_KEY_BLOB header.
// It extracts the DSA private value and parameters from the byte slice and stores them in the BCRYPT_DSA_PRIVATE_KEY structure.

Copilot uses AI. Check for mistakes.
@p0dalirius p0dalirius deleted the Rename-all-structures-to-keep-a-consistent-naming-convention branch November 6, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants