]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
STS: when generating keys, take the trailing character into account 54128/head
authorOguzhan Ozmen <oozmen@bloomberg.net>
Tue, 3 Oct 2023 20:05:39 +0000 (16:05 -0400)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Fri, 20 Oct 2023 19:54:14 +0000 (15:54 -0400)
Otherwise, STS acckey has 19 and secret key has 39 alphanumeric chars.

Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
(cherry picked from commit 637613eb148157f30f8524dc99e508cf674b7b9f)

src/rgw/rgw_sts.cc

index 4c3d75925fe5e06ec6186e3d9ad48ca3d39dc36c..c8facc554d0615104c3ae9b750bafeea5d8d9b12 100644 (file)
@@ -54,7 +54,7 @@ int Credentials::generateCredentials(const DoutPrefixProvider *dpp,
                           rgw::auth::Identity* identity)
 {
   uuid_d accessKey, secretKey;
-  char accessKeyId_str[MAX_ACCESS_KEY_LEN], secretAccessKey_str[MAX_SECRET_KEY_LEN];
+  char accessKeyId_str[MAX_ACCESS_KEY_LEN + 1], secretAccessKey_str[MAX_SECRET_KEY_LEN + 1];
 
   //AccessKeyId
   gen_rand_alphanumeric_plain(cct, accessKeyId_str, sizeof(accessKeyId_str));