using namespace std;
+using ceph::crypto::MD5;
+
#define RGW_ATTR_PREFIX "user.rgw."
#define RGW_ATTR_ACL RGW_ATTR_PREFIX "acl"
std::string name;
size_t size;
time_t mtime;
- char etag[CryptoPP::Weak::MD5::DIGESTSIZE * 2 + 1];
+ char etag[MD5::DIGESTSIZE * 2 + 1];
uint64_t count;
void encode(bufferlist& bl) const {
#include <errno.h>
#include <string.h>
-#include <cryptopp/sha.h>
-#include <cryptopp/hmac.h>
+#include "common/ceph_crypto.h"
#include "rgw_rest.h"
#include "rgw_rest_s3.h"
#include "common/armor.h"
-using namespace CryptoPP;
+using namespace ceph::crypto;
void list_all_buckets_start(struct req_state *s)
{
const char *msg, int msg_len,
char *dest, int *len) /* dest should be large enough to hold result */
{
- if (*len < HMAC<SHA1>::DIGESTSIZE)
+ if (*len < HMACSHA1::DIGESTSIZE)
return -EINVAL;
- char hex_str[HMAC<SHA1>::DIGESTSIZE * 2 + 1];
+ char hex_str[HMACSHA1::DIGESTSIZE * 2 + 1];
- HMAC<SHA1> hmac((const unsigned char *)key, key_len);
+ HMACSHA1 hmac((const unsigned char *)key, key_len);
hmac.Update((const unsigned char *)msg, msg_len);
hmac.Final((unsigned char *)dest);
- *len = HMAC<SHA1>::DIGESTSIZE;
+ *len = HMACSHA1::DIGESTSIZE;
buf_to_hex((unsigned char *)dest, *len, hex_str);
const char *key = s->user.secret_key.c_str();
int key_len = strlen(key);
- char hmac_sha1[HMAC<SHA1>::DIGESTSIZE];
+ char hmac_sha1[HMACSHA1::DIGESTSIZE];
int len = sizeof(hmac_sha1);
if (calc_hmac_sha1(key, key_len, auth_hdr.c_str(), auth_hdr.size(), hmac_sha1, &len) < 0)
return false;