From: Oguzhan Ozmen Date: Tue, 3 Oct 2023 20:05:39 +0000 (-0400) Subject: STS: when generating keys, take the trailing character into account X-Git-Tag: v19.0.0~265^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=637613eb148157f30f8524dc99e508cf674b7b9f;p=ceph.git STS: when generating keys, take the trailing character into account Otherwise, STS acckey has 19 and secret key has 39 alphanumeric chars. Signed-off-by: Oguzhan Ozmen --- diff --git a/src/rgw/rgw_sts.cc b/src/rgw/rgw_sts.cc index b552834426a9..2b31d5c5a297 100644 --- a/src/rgw/rgw_sts.cc +++ b/src/rgw/rgw_sts.cc @@ -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));