Wenzhe Zhou has posted comments on this change. ( http://gerrit.cloudera.org:8080/17663 )
Change subject: IMPALA-10489 part2: Support RSASSA-PSS and EC Algorithms for JWT ...................................................................... Patch Set 1: (2 comments) http://gerrit.cloudera.org:8080/#/c/17663/1/be/src/util/jwt-util-test.cc File be/src/util/jwt-util-test.cc: http://gerrit.cloudera.org:8080/#/c/17663/1/be/src/util/jwt-util-test.cc@634 PS1, Line 634: TempTestDataFile jwks_file(Substitute(jwks_rsa_file_format, kid_1, "PS384", : rsa_pub_key_jwk_n, rsa_pub_key_jwk_e, kid_2, "PS384", rsa_invalid_pub_key_jwk_n, : rsa_pub_key_jwk_e)); > I'm seeing that PS256/PS384/PS512 use the same RSA public key to initialize Added 3 different sizes of RSA keys, and use 1024 bits RSA key for PS256, 2048 bits RSA key for PS384, and 4096 bits RSA key for PS512. http://gerrit.cloudera.org:8080/#/c/17663/1/be/src/util/jwt-util.cc File be/src/util/jwt-util.cc: http://gerrit.cloudera.org:8080/#/c/17663/1/be/src/util/jwt-util.cc@313 PS1, Line 313: if (algorithm.compare("rs256") == 0) { : jwt_pub_key = new RS256JWTPublicKey(algorithm, pub_key); : } else if (algorithm.compare("rs384") == 0) { : jwt_pub_key = new RS384JWTPublicKey(algorithm, pub_key); : } else if (algorithm.compare("rs512") == 0) { : jwt_pub_key = new RS512JWTPublicKey(algorithm, pub_key); : } else if (algorithm.compare("ps256") == 0) { : jwt_pub_key = new PS256JWTPublicKey(algorithm, pub_key); : } else if (algorithm.compare("ps384") == 0) { : jwt_pub_key = new PS384JWTPublicKey(algorithm, pub_key); : } else if (algorithm.compare("ps512") == 0) { : jwt_pub_key = new PS512JWTPublicKey(algorithm, pub_key); > Nit: Very minor thing, but the C++ std library implements the "==" relation replaced compare() with "==". Tried "switch" for string, but got compiling error. It seems we cannot simply use "switch" for string statement. One work around is to convert string to enum. -- To view, visit http://gerrit.cloudera.org:8080/17663 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib4dc30c51f503b609dd311ce4387080abc5a0832 Gerrit-Change-Number: 17663 Gerrit-PatchSet: 1 Gerrit-Owner: Wenzhe Zhou <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Wenzhe Zhou <[email protected]> Gerrit-Comment-Date: Wed, 14 Jul 2021 15:50:44 +0000 Gerrit-HasComments: Yes
