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

[Fix]: Provide a meaningful error for cert sanitization #4307

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

C0rWin
Copy link
Contributor

@C0rWin C0rWin commented Jul 3, 2023

This commit handles the error where the certificate sanitization procedure fails to construct the certificate chain due to misconfiguration. Before this commit, the peer will simply fail with panic without a clear explanation of what exactly was wrong.

Addresses (#4302).

@C0rWin C0rWin requested a review from a team as a code owner July 3, 2023 11:52
This commit takes care to handle the error where certificate
sanitization procedure fails to construct certificate chain due to
misconfiguration. Before this commit, the peer will simply fail with
panic without clear explanation of what exactly was wrong.

Addresses (hyperledger#4302).

Signed-off-by: Artem Barger <artem@bargr.net>
// to sanitize the cert whenever it's intermediate or leaf certificate
parentCert := chain[1]
var parentCert *x509.Certificate
Copy link
Contributor

Choose a reason for hiding this comment

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

i think it's safe to merge since if it's not at least of size 1, it crashes... right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep.

@yacovm
Copy link
Contributor

yacovm commented Jul 3, 2023

LGTM, maybe also @ale-linux can take a look

@yacovm yacovm merged commit ffc6803 into hyperledger:main Jul 5, 2023
13 checks passed
@yacovm
Copy link
Contributor

yacovm commented Jul 5, 2023

@denyeart this should probably be backported, and reviewed again by someone else

pfi79 pushed a commit to scientificideas/fabric that referenced this pull request Jul 10, 2023
…4307)

This commit takes care to handle the error where certificate
sanitization procedure fails to construct certificate chain due to
misconfiguration. Before this commit, the peer will simply fail with
panic without clear explanation of what exactly was wrong.

Addresses (hyperledger#4302).

Signed-off-by: Artem Barger <artem@bargr.net>
(cherry picked from commit ffc6803)
@denyeart
Copy link
Contributor

@Mergifyio backport release-2.5

@mergify
Copy link

mergify bot commented Jul 19, 2023

backport release-2.5

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jul 19, 2023
This commit takes care to handle the error where certificate
sanitization procedure fails to construct certificate chain due to
misconfiguration. Before this commit, the peer will simply fail with
panic without clear explanation of what exactly was wrong.

Addresses (#4302).

Signed-off-by: Artem Barger <artem@bargr.net>
(cherry picked from commit ffc6803)
@denyeart
Copy link
Contributor

LGTM, backported to release-2.5.

denyeart pushed a commit that referenced this pull request Jul 19, 2023
This commit takes care to handle the error where certificate
sanitization procedure fails to construct certificate chain due to
misconfiguration. Before this commit, the peer will simply fail with
panic without clear explanation of what exactly was wrong.

Addresses (#4302).

Signed-off-by: Artem Barger <artem@bargr.net>
(cherry picked from commit ffc6803)
pfi79 added a commit to scientificideas/fabric that referenced this pull request Jul 20, 2023
* release-2.5:
  Bump Go to 1.20.6 (release-2.5) (hyperledger#4322)
  [Fix]: Provide a meaningful error for cert sanitization (hyperledger#4307)

# Conflicts:
#	.github/workflows/release.yml
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.

3 participants