Skip to content

Commit

Permalink
[#5594][Platform]:Handle invalid certs/keys correctly. (#7264)
Browse files Browse the repository at this point in the history
* Heading:
[5594][Platform] Handle invalid certs/keys correctly
Description:
We wanted to verify the cert at upload time itself.
Testing:
When we try to upload selfSigned cert, we were able to upload any
garbage files. Now with this fix, we have handled this scenrio. User
won't be able to upload garbage file. Incase of self signed cert upload
workflow, We are matching the modulus of
cert RSA Public key with the modulus of its private key if its matched
then it means certs are valid otheriwse Invalid.
For CA Cert, we are just validating the Cert format.
Added the unit Tests as well.

(cherry picked from commit 5f8d39a)

* Heading:
[5594][Platform] Handle invalid certs/keys correctly
Description:
We wanted to verify the cert at upload time itself.
Testing:
When we try to upload selfSigned cert, we were able to upload any
garbage files. Now with this fix, we have handled this scenrio. User
won't be able to upload garbage file. Incase of self signed cert upload
workflow, We are matching the modulus of
cert RSA Public key with the modulus of its private key if its matched
then it means certs are valid otheriwse Invalid.
For CA Cert, we are just validating the Cert format.
Added the unit Tests as well.

(cherry picked from commit 5f8d39a)

Co-authored-by: jitendra-12113 <jitedra.kumar@hashedin.com>
  • Loading branch information
jitendra-12113 and jitendra-12113 committed Feb 17, 2021
1 parent b850e08 commit 37cf988
Show file tree
Hide file tree
Showing 4 changed files with 309 additions and 127 deletions.
Loading

0 comments on commit 37cf988

Please sign in to comment.