Commit ca6402a0 authored by yiwenshao's avatar yiwenshao

able to use conf and don't know why

parent c95f1a86
#oDET: DETJOIN DET RND
#oOPE: OPEFOREIGN OPE RND
#oAGG: HOM
#oASHE: ASHE
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPEFOREIGN OPE RND
oAGG: HOM
[end]
#oSWP: SEARCH
#oDET: DETJOIN DET RND
#oOPE: OPEFOREIGN OPE RND
[onions for str]
oDET: DETJOIN DET RND
oOPE: OPEFOREIGN OPE RND
oSWP: SEARCH
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPEFOREIGN OPE RND
oAGG: HOM
[end]
[onions for str]
oDET: DETJOIN DET RND
oOPE: OPEFOREIGN OPE RND
......@@ -2,7 +2,7 @@
#include <assert.h>
static
void is_onionlayout_equal(onionlayout &ol1,onionlayout &ol2){
void test_is_onionlayout_equal(onionlayout &ol1,onionlayout &ol2){
for(auto item:ol1){
auto key = item.first;
assert(ol2.find(key)!=ol2.end());
......@@ -16,11 +16,11 @@ int main(){
onion_conf of(di);
auto res = of.get_onionlayout_for_num();
auto res2 = of.get_onionlayout_for_str();
is_onionlayout_equal(res,NUM_ONION_LAYOUT);
is_onionlayout_equal(NUM_ONION_LAYOUT,res);
test_is_onionlayout_equal(res,NUM_ONION_LAYOUT);
test_is_onionlayout_equal(NUM_ONION_LAYOUT,res);
is_onionlayout_equal(res2,STR_ONION_LAYOUT);
is_onionlayout_equal(STR_ONION_LAYOUT,res2);
test_is_onionlayout_equal(res2,STR_ONION_LAYOUT);
test_is_onionlayout_equal(STR_ONION_LAYOUT,res2);
return 0;
}
......@@ -431,11 +431,15 @@ onionlayout FieldMeta::determineOnionLayout(const AES_KEY *const m_key,
/*we only support sensitive rating here*/
if (SECURITY_RATING::SENSITIVE == sec_rating) {
if (true == isMySQLTypeNumeric(f)) {
//return CURRENT_NUM_LAYOUT;
//is_onionlayout_equal(CURRENT_NUM_LAYOUT,NUM_ONION_LAYOUT);
//is_onionlayout_equal(NUM_ONION_LAYOUT, CURRENT_NUM_LAYOUT);
return CURRENT_NUM_LAYOUT;
// return NUM_ONION_LAYOUT;
} else {
// return CURRENT_STR_LAYOUT;
//is_onionlayout_equal(CURRENT_STR_LAYOUT,STR_ONION_LAYOUT);
//is_onionlayout_equal(STR_ONION_LAYOUT,CURRENT_STR_LAYOUT);
return CURRENT_STR_LAYOUT;
// return STR_ONION_LAYOUT;
}
} else if (SECURITY_RATING::BEST_EFFORT == sec_rating) {
if (true == isMySQLTypeNumeric(f)) {
......
......@@ -146,4 +146,12 @@ onionlayout CURRENT_NUM_LAYOUT = global_onion_conf.get_onionlayout_for_num();
onionlayout CURRENT_STR_LAYOUT = global_onion_conf.get_onionlayout_for_str();
void is_onionlayout_equal(onionlayout &ol1,onionlayout &ol2){
for(auto item:ol1){
auto key = item.first;
assert(ol2.find(key)!=ol2.end());
assert(ol2[key]==ol1[key]);
}
}
......@@ -121,7 +121,7 @@ static onionlayout STR_ONION_LAYOUT = {
{oDET, std::vector<SECLEVEL>({SECLEVEL::DETJOIN, SECLEVEL::DET,
SECLEVEL::RND})},
{oOPE, std::vector<SECLEVEL>({SECLEVEL::OPEFOREIGN, SECLEVEL::OPE, SECLEVEL::RND})},
//{oSWP, std::vector<SECLEVEL>({SECLEVEL::SEARCH})}
{oSWP, std::vector<SECLEVEL>({SECLEVEL::SEARCH})}
// {oSWP, std::vector<SECLEVEL>({SECLEVEL::PLAINVAL, SECLEVEL::DET,
// SECLEVEL::RND})}
};
......@@ -189,3 +189,8 @@ public:
extern onionlayout CURRENT_NUM_LAYOUT;
extern onionlayout CURRENT_STR_LAYOUT;
void is_onionlayout_equal(onionlayout &ol1,onionlayout &ol2);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment