duckdb 0.5.2-dev671.0 → 0.5.2-dev674.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb.cpp +28 -4
- package/src/duckdb.hpp +2 -2
- package/src/parquet-amalgamation.cpp +37553 -37553
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -139886,8 +139886,12 @@ inline std::string GetDLError(void) {
|
|
|
139886
139886
|
namespace duckdb_mbedtls {
|
|
139887
139887
|
class MbedTlsWrapper {
|
|
139888
139888
|
public:
|
|
139889
|
+
static void ComputeSha256Hash(const char* in, size_t in_len, char* out);
|
|
139889
139890
|
static std::string ComputeSha256Hash(const std::string& file_content);
|
|
139890
139891
|
static bool IsValidSha256Signature(const std::string& pubkey, const std::string& signature, const std::string& sha256_hash);
|
|
139892
|
+
static void Hmac256(const char* key, size_t key_len, const char* message, size_t message_len, char* out);
|
|
139893
|
+
|
|
139894
|
+
static constexpr size_t SHA256_HASH_BYTES = 32;
|
|
139891
139895
|
};
|
|
139892
139896
|
}
|
|
139893
139897
|
|
|
@@ -328632,16 +328636,20 @@ openssl pkeyutl -sign -in hash -inkey private.pem -pkeyopt digest:sha256 -out du
|
|
|
328632
328636
|
*/
|
|
328633
328637
|
|
|
328634
328638
|
|
|
328635
|
-
|
|
328636
|
-
string hash;
|
|
328637
|
-
hash.resize(32);
|
|
328639
|
+
void MbedTlsWrapper::ComputeSha256Hash(const char* in, size_t in_len, char* out) {
|
|
328638
328640
|
|
|
328639
328641
|
mbedtls_sha256_context sha_context;
|
|
328640
328642
|
mbedtls_sha256_init(&sha_context);
|
|
328641
|
-
if(mbedtls_sha256_starts(&sha_context, false) || mbedtls_sha256_update(&sha_context, (const unsigned char*)
|
|
328643
|
+
if(mbedtls_sha256_starts(&sha_context, false) || mbedtls_sha256_update(&sha_context, (const unsigned char*) in, in_len) || mbedtls_sha256_finish(&sha_context, (unsigned char*)out)) {
|
|
328642
328644
|
throw runtime_error("SHA256 Error");
|
|
328643
328645
|
}
|
|
328644
328646
|
mbedtls_sha256_free(&sha_context);
|
|
328647
|
+
}
|
|
328648
|
+
|
|
328649
|
+
string MbedTlsWrapper::ComputeSha256Hash(const string& file_content) {
|
|
328650
|
+
string hash;
|
|
328651
|
+
hash.resize(MbedTlsWrapper::SHA256_HASH_BYTES);
|
|
328652
|
+
ComputeSha256Hash(file_content.data(), file_content.size(), (char*)hash.data());
|
|
328645
328653
|
return hash;
|
|
328646
328654
|
}
|
|
328647
328655
|
|
|
@@ -328668,6 +328676,22 @@ bool MbedTlsWrapper::IsValidSha256Signature(const std::string &pubkey, const std
|
|
|
328668
328676
|
return valid;
|
|
328669
328677
|
}
|
|
328670
328678
|
|
|
328679
|
+
// used in s3fs
|
|
328680
|
+
void MbedTlsWrapper::Hmac256(const char* key, size_t key_len, const char* message, size_t message_len, char* out) {
|
|
328681
|
+
mbedtls_md_context_t hmac_ctx;
|
|
328682
|
+
const mbedtls_md_info_t *md_type = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256);
|
|
328683
|
+
if (!md_type) {
|
|
328684
|
+
throw runtime_error("failed to init hmac");
|
|
328685
|
+
}
|
|
328686
|
+
|
|
328687
|
+
if (mbedtls_md_setup(&hmac_ctx, md_type, 1) ||
|
|
328688
|
+
mbedtls_md_hmac_starts(&hmac_ctx, (const unsigned char *) key, key_len) ||
|
|
328689
|
+
mbedtls_md_hmac_update(&hmac_ctx, (const unsigned char *)message, message_len) ||
|
|
328690
|
+
mbedtls_md_hmac_finish(&hmac_ctx, (unsigned char *) out)) {
|
|
328691
|
+
throw runtime_error("HMAC256 Error");
|
|
328692
|
+
}
|
|
328693
|
+
mbedtls_md_free(&hmac_ctx);
|
|
328694
|
+
}
|
|
328671
328695
|
|
|
328672
328696
|
// LICENSE_CHANGE_END
|
|
328673
328697
|
|
package/src/duckdb.hpp
CHANGED
|
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
11
11
|
#pragma once
|
|
12
12
|
#define DUCKDB_AMALGAMATION 1
|
|
13
13
|
#define DUCKDB_AMALGAMATION_EXTENDED 1
|
|
14
|
-
#define DUCKDB_SOURCE_ID "
|
|
15
|
-
#define DUCKDB_VERSION "v0.5.2-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "0543dbc6f"
|
|
15
|
+
#define DUCKDB_VERSION "v0.5.2-dev674"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|