当前位置: 首页>>代码示例>>C++>>正文


C++ ABC_CHECK函数代码示例

本文整理汇总了C++中ABC_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ ABC_CHECK函数的具体用法?C++ ABC_CHECK怎么用?C++ ABC_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ABC_CHECK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loginServerUpdatePinPackage

Status
loginServerUpdatePinPackage(const Login &login,
                            DataSlice DID, DataSlice LPIN1, const std::string &pinPackage,
                            time_t ali)
{
    const auto url = ABC_SERVER_ROOT "/account/pinpackage/update";

    // format the ali
    char szALI[DATETIME_LENGTH];
    strftime(szALI, DATETIME_LENGTH, "%Y-%m-%dT%H:%M:%S", gmtime(&ali));

    // Encode those:
    JsonPtr json(json_pack("{ss, ss, ss, ss, ss, ss}",
                           ABC_SERVER_JSON_L1_FIELD, base64Encode(login.lobby.authId()).c_str(),
                           ABC_SERVER_JSON_LP1_FIELD, base64Encode(login.authKey()).c_str(),
                           ABC_SERVER_JSON_DID_FIELD, base64Encode(DID).c_str(),
                           ABC_SERVER_JSON_LPIN1_FIELD, base64Encode(LPIN1).c_str(),
                           JSON_ACCT_PIN_PACKAGE, pinPackage.c_str(),
                           ABC_SERVER_JSON_ALI_FIELD, szALI));

    HttpReply reply;
    ABC_CHECK(AirbitzRequest().post(reply, url, json.encode()));
    ServerReplyJson replyJson;
    ABC_CHECK(replyJson.decode(reply.body));
    ABC_CHECK(replyJson.ok());

    return Status();
}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:28,代码来源:LoginServer.cpp

示例2: ABC_CHECK

Status
ServerRequestJson::setup(const Login &login)
{
    ABC_CHECK(setup(login.store));
    ABC_CHECK(passwordAuthSet(base64Encode(login.passwordAuth())));
    return Status();
}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:7,代码来源:LoginServer.cpp

示例3: ABC_CHECK

Status
ServerRequestJson::setup(const Login &login)
{
    ABC_CHECK(setup(login.lobby));
    ABC_CHECK(authKeySet(base64Encode(login.authKey())));
    return Status();
}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:7,代码来源:LoginServer.cpp

示例4: ABC_CHECK

Status
JsonBox::decrypt(DataChunk &result, DataSlice key)
{
    DataChunk nonce;
    ABC_CHECK(nonceOk());
    ABC_CHECK(base16Decode(nonce, this->nonce()));

    DataChunk cyphertext;
    ABC_CHECK(cyphertextOk());
    ABC_CHECK(base64Decode(cyphertext, this->cyphertext()));

    switch (type())
    {
    case AES256_CBC_AIRBITZ:
    {
        ABC_CHECK_OLD(ABC_CryptoDecryptAES256Package(result,
                      cyphertext, key, nonce,
                      &error));
        return Status();
    }

    default:
        return ABC_ERROR(ABC_CC_DecryptError, "Unknown encryption type");
    }
}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:25,代码来源:JsonBox.cpp

示例5: loginServerGetPinPackage

Status
loginServerGetPinPackage(DataSlice DID, DataSlice LPIN1, std::string &result,
                         AuthError &authError)
{
    const auto url = ABC_SERVER_ROOT "/v1/account/pinpackage/get";
    ServerRequestJson json;
    ABC_CHECK(json.set(ABC_SERVER_JSON_DID_FIELD, base64Encode(DID)));
    ABC_CHECK(json.set(ABC_SERVER_JSON_LPIN1_FIELD, base64Encode(LPIN1)));

    HttpReply reply;
    ABC_CHECK(AirbitzRequest().post(reply, url, json.encode()));
    ServerReplyJson replyJson;
    ABC_CHECK(replyJson.decode(reply, &authError));

    struct ResultJson:
        public JsonObject
    {
        ABC_JSON_CONSTRUCTORS(ResultJson, JsonObject)
        ABC_JSON_STRING(package, "pin_package", nullptr)
    } resultJson(replyJson.results());

    ABC_CHECK(resultJson.packageOk());
    result = resultJson.package();
    return Status();
}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:25,代码来源:LoginServer.cpp

示例6: loginServerChangePassword

Status
loginServerChangePassword(const Login &login,
                          DataSlice newLP1, DataSlice newLRA1,
                          const CarePackage &carePackage, const LoginPackage &loginPackage)
{
    const auto url = ABC_SERVER_ROOT "/account/password/update";
    JsonPtr json(json_pack("{ss, ss, ss, ss, ss}",
                           ABC_SERVER_JSON_L1_FIELD,      base64Encode(login.lobby.authId()).c_str(),
                           ABC_SERVER_JSON_LP1_FIELD,     base64Encode(login.authKey()).c_str(),
                           ABC_SERVER_JSON_NEW_LP1_FIELD, base64Encode(newLP1).c_str(),
                           ABC_SERVER_JSON_CARE_PACKAGE_FIELD,  carePackage.encode().c_str(),
                           ABC_SERVER_JSON_LOGIN_PACKAGE_FIELD, loginPackage.encode().c_str()));
    if (newLRA1.size())
    {
        json_object_set_new(json.get(), ABC_SERVER_JSON_NEW_LRA1_FIELD,
                            json_string(base64Encode(newLRA1).c_str()));
    }

    HttpReply reply;
    ABC_CHECK(AirbitzRequest().post(reply, url, json.encode()));
    ServerReplyJson replyJson;
    ABC_CHECK(replyJson.decode(reply.body));
    ABC_CHECK(replyJson.ok());

    return Status();
}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:26,代码来源:LoginServer.cpp

示例7: loginServerOtpStatus

Status
loginServerOtpStatus(const Login &login, bool &on, long &timeout)
{
    const auto url = ABC_SERVER_ROOT "/v1/otp/status";
    ServerRequestJson json;
    ABC_CHECK(json.setup(login));

    HttpReply reply;
    ABC_CHECK(AirbitzRequest().post(reply, url, json.encode()));
    ServerReplyJson replyJson;
    ABC_CHECK(replyJson.decode(reply));

    struct ResultJson:
        public JsonObject
    {
        ABC_JSON_CONSTRUCTORS(ResultJson, JsonObject)
        ABC_JSON_BOOLEAN(on, "on", false)
        ABC_JSON_INTEGER(timeout, "otp_timeout", 0)
    } resultJson(replyJson.results());

    on = resultJson.on();
    if (on)
    {
        ABC_CHECK(resultJson.timeoutOk());
        timeout = resultJson.timeout();
    }
    return Status();
}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:28,代码来源:LoginServer.cpp

示例8: accountCategoriesRemove

Status
accountCategoriesRemove(const Account &account, const std::string &category)
{
    AccountCategories categories;
    ABC_CHECK(accountCategoriesLoad(categories, account));
    categories.erase(category);
    ABC_CHECK(accountCategoriesSave(account, categories));
    return Status();
}
开发者ID:codeaudit,项目名称:airbitz-core,代码行数:9,代码来源:AccountCategories.cpp

示例9: ABC_CHECK

Status
Account::load()
{
    // If the sync dir doesn't exist, create it:
    ABC_CHECK(syncEnsureRepo(dir(), login.lobby.dir() + "tmp/", login.syncKey()));

    ABC_CHECK(wallets.load());
    return Status();
}
开发者ID:BitcoinKinetics,项目名称:airbitz-core,代码行数:9,代码来源:Account.cpp

示例10: ABC_CHECK

Status
Login::loadOffline()
{
    ABC_CHECK(store.paths(paths, true));

    LoginPackage loginPackage;
    ABC_CHECK(loginPackage.load(paths.loginPackagePath()));
    ABC_CHECK(loginPackage.passwordAuthBox().decrypt(passwordAuth_, dataKey_));

    // Look for an existing rootKeyBox:
    JsonBox rootKeyBox;
    if (fileExists(paths.rootKeyPath()))
    {
        ABC_CHECK(rootKeyBox.load(paths.rootKeyPath()));
    }
    else
    {
        // Try asking the server:
        AuthJson authJson;
        LoginReplyJson loginJson;
        ABC_CHECK(authJson.loginSet(*this));
        ABC_CHECK(loginServerLogin(loginJson, authJson));
        ABC_CHECK(loginJson.save(*this));
        rootKeyBox = loginJson.rootKeyBox();
    }
    // Otherwise, there just isn't one.

    // Extract the rootKey:
    if (rootKeyBox.ok())
        ABC_CHECK(rootKeyBox.decrypt(rootKey_, dataKey_));
    else
        ABC_CHECK(rootKeyUpgrade());

    return Status();
}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:35,代码来源:Login.cpp

示例11: loginServerPasswordSet

Status
loginServerPasswordSet(AuthJson authJson,
                       DataSlice passwordAuth,
                       JsonPtr passwordKeySnrp,
                       JsonPtr passwordBox,
                       JsonPtr passwordAuthBox)
{
    const auto url = ABC_SERVER_ROOT "/v2/login/password";

    JsonSnrp passwordAuthSnrp;
    ABC_CHECK(passwordAuthSnrp.snrpSet(usernameSnrp()));

    JsonObject dataJson;
    ABC_CHECK(dataJson.set("passwordAuth", base64Encode(passwordAuth)));
    ABC_CHECK(dataJson.set("passwordAuthSnrp", passwordAuthSnrp));
    ABC_CHECK(dataJson.set("passwordKeySnrp", passwordKeySnrp));
    ABC_CHECK(dataJson.set("passwordBox", passwordBox));
    ABC_CHECK(dataJson.set("passwordAuthBox", passwordAuthBox));
    ABC_CHECK(authJson.set("data", dataJson));

    HttpReply reply;
    ABC_CHECK(AirbitzRequest().request(reply, url, "PUT", authJson.encode()));
    ServerReplyJson replyJson;
    ABC_CHECK(replyJson.decode(reply));

    return Status();
}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:27,代码来源:LoginServer.cpp

示例12: watcherSave

Status
watcherSave(Wallet &self)
{
    Watcher *watcher = nullptr;
    ABC_CHECK(watcherFind(watcher, self));

    auto data = watcher->serialize();;
    ABC_CHECK(fileSave(data, watcherPath(self)));

    return Status();
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:11,代码来源:WatcherBridge.cpp

示例13: ABC_CHECK

Status
Wallet::createNew(std::shared_ptr<Wallet> &result, Account &account,
                  const std::string &name, int currency)
{
    std::string id;
    ABC_CHECK(randomUuid(id));
    std::shared_ptr<Wallet> out(new Wallet(account, id));
    ABC_CHECK(out->createNew(name, currency));

    result = std::move(out);
    return Status();
}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:12,代码来源:Wallet.cpp

示例14: lock

Status
Wallet::nameSet(const std::string &name)
{
    std::lock_guard<std::mutex> lock(mutex_);

    name_ = name;
    NameJson json;
    ABC_CHECK(json.nameSet(name));
    ABC_CHECK(json.save(syncDir() + WALLET_NAME_FILENAME, dataKey()));

    return Status();
}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:12,代码来源:Wallet.cpp

示例15: loginServerRecovery2Delete

Status
loginServerRecovery2Delete(AuthJson authJson)
{
    const auto url = ABC_SERVER_ROOT "/v2/login/recovery2";

    HttpReply reply;
    ABC_CHECK(AirbitzRequest().request(reply, url, "DELETE", authJson.encode()));
    ServerReplyJson replyJson;
    ABC_CHECK(replyJson.decode(reply));

    return Status();
}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:12,代码来源:LoginServer.cpp


注:本文中的ABC_CHECK函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。