Skip to content

reef: rgw/sts: Implementation of validating JWT using modulus and exponent - #63053

Merged
yuriw merged 5 commits into
ceph:reeffrom
pritha-srivastava:wip-71106-reef
May 29, 2025
Merged

yuriw merged 5 commits into
ceph:reeffrom
pritha-srivastava:wip-71106-reef

Conversation

@pritha-srivastava

Copy link
Copy Markdown
Contributor

using modulus and exponent for RSA group of algorithms.

A couple of issues and a fix have been suggested by
Pupu Toivonen ([email protected]) in signature calculation
using modulus and exponent.

Fixes: https://tracker.ceph.com/issues/51018
Signed-off-by: Pritha Srivastava <[email protected]>
(cherry picked from commit b368cab)
@pritha-srivastava
pritha-srivastava requested a review from a team as a code owner April 30, 2025 06:24
@pritha-srivastava pritha-srivastava added this to the reef milestone Apr 30, 2025
'sig' for signature validation of the token.

Fixes: https://tracker.ceph.com/issues/54562
Signed-off-by: Pritha Srivastava <[email protected]>
(cherry picked from commit 4c08b48)
to https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc_verify-thumbprint.html
for n&e which can be later used for all key types
(x5c, n&e).

Signed-off-by: Pritha Srivastava <[email protected]>
(cherry picked from commit d970f62)

 Conflicts:
	src/rgw/rgw_rest_sts.cc
the conflict was due to validate_signature() taking thumbprints
in place of provider.thumbprints as input param.
if aud is not present in JWT.

Signed-off-by: Pritha Srivastava <[email protected]>
(cherry picked from commit b5bbeb7)
@pritha-srivastava

pritha-srivastava commented Apr 30, 2025 •

Copy link
Copy Markdown
Contributor Author

@cbodley @adamemerson : I see this build failure

In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_rest_sts.cc:28:
In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_rest.h:14:
In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_op.h:50:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_torrent.h:110:3: error: must use 'class' tag to refer to type 'SHA1' in this scope
  SHA1 h;
  ^
  class 
/usr/include/openssl/sha.h:55:16: note: class 'SHA1' is hidden by a non-type declaration of 'SHA1' here
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);

but this header file rgw_rest.h was already included in rgw_rest_sts.cc and has not been introduced by this PR.

or could it be conflicting with the newly included header files:

#include <openssl/ssl.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/bio.h>

@cbodley

cbodley commented Apr 30, 2025

Copy link
Copy Markdown
Contributor

or could it be conflicting with the newly included header files:

#include <openssl/ssl.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/bio.h>

yeah looks like the openssl SHA1() function name conflicts with the using ceph::crypto::SHA1; alias in rgw_torrent.h. header files shouldn't abuse using like that, and i had rewritten rgw_torrent.h for squid

for this reef backport, you might move that using ceph::crypto::SHA1; alias to rgw_torrent.cc and make rgw_torrent.h use the fully-qualified name

@adamemerson adamemerson modified the milestones: reef, v18.2.7 May 2, 2025
openssl SHA1() method and using ceph::crypto::SHA1
alias in rgw_torrent.h

Signed-off-by: Pritha Srivastava <[email protected]>
@pritha-srivastava

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@pritha-srivastava

Copy link
Copy Markdown
Contributor Author

make check failures:

	 36 - smoke.sh (Timeout)
	179 - mgr-dashboard-smoke.sh (Failed)
	186 - unittest_bluefs (Timeout)
	189 - unittest_deferred (Subprocess aborted)
	193 - safe-to-destroy.sh (Timeout)
Errors while running CTest

crash:

1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x1ac) [0x7f1a6e6c21bc]
 2: /home/jenkins-build/build/workspace/ceph-pull-requests/build/lib/libceph-common.so.2(+0x155c00f) [0x7f1a6e6c200f]
 3: (create_deferred_and_terminate()+0x1ae7) [0x55b98d00b3d7]
 4: main()
 5: /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f1a6c53ed90]
 6: __libc_start_main()
 7: _start()
2025-05-19T09:56:31.908+0000 7f1a6b978580 -1 bluestore(bluestore.test_temp_dir/block) _read_bdev_label failed to open bluestore.test_temp_dir/block: (2) No such file or directory
2025-05-19T09:56:31.908+0000 7f1a6b978580 -1 bluestore(bluestore.test_temp_dir/block) _read_bdev_label failed to open bluestore.test_temp_dir/block: (2) No such file or directory
2025-05-19T09:56:31.908+0000 7f1a6b978580 -1 bluestore(bluestore.test_temp_dir/block) _read_bdev_label failed to open bluestore.test_temp_dir/block: (2) No such file or directory

the above failures do not look related to this PR

@pritha-srivastava

Copy link
Copy Markdown
Contributor Author

@adamemerson @cbodley : I have added a separate commit that fixes the compilation error - is this ok, or should I squash it onto the previous commit.

@yuriw

yuriw commented May 27, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@cbodley

cbodley commented May 28, 2025

Copy link
Copy Markdown
Contributor

@adamemerson @cbodley : I have added a separate commit that fixes the compilation error - is this ok, or should I squash it onto the previous commit.

@pritha-srivastava should be squashed into the commit that introduced the error, with the change documented in the commit message under "Conflicts:" (see https://github.com/ceph/ceph/blob/main/SubmittingPatches-backports.rst#cherry-picking-rules)

@yuriw

yuriw commented May 28, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@yuriw
yuriw merged commit 7773709 into ceph:reef May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants