Пример #1
0
void AccessConfig::assign(const AccessConfig& s) {
    setUsername (s.getUsername() );
    setPassword (s.getPassword() );
    setSyncURL  (s.getSyncURL()  );
    setProxyHost(s.getProxyHost());
    setProxyPort(s.getProxyPort());
    setUserAgent(s.getUserAgent());

    setProxyUsername(s.getProxyUsername());
    setProxyPassword(s.getProxyPassword());
    setBeginSync(s.getBeginSync());
    setEndSync(s.getEndSync());
    setFirstTimeSyncMode(s.getFirstTimeSyncMode());

    setServerAuthRequired(s.getServerAuthRequired());
    setClientAuthType(s.getClientAuthType());
    setServerAuthType(s.getServerAuthType());
    setServerPWD(s.getServerPWD());
    setServerID(s.getServerID());
    setServerNonce(s.getServerNonce());
    setClientNonce(s.getClientNonce());
    setMaxMsgSize(s.getMaxMsgSize());
    setReadBufferSize(s.getReadBufferSize());
    setCheckConn(s.getCheckConn());
    setResponseTimeout(s.getResponseTimeout());
    setCompression(s.getCompression());

    dirty = s.getDirty();
}
Пример #2
0
Chal* CredentialHandler::getServerChal(bool isServerAuthenticated) {

    Chal* chal = NULL;

    if (strcmp(serverAuthType, AUTH_TYPE_BASIC) == 0 && isServerAuthenticated == false) {
        chal = Chal::getBasicChal();

    } else if (strcmp(serverAuthType, AUTH_TYPE_MD5) == 0) { // MD5
        chal = Chal::getMD5Chal();
        char nonce[16];
        generateNonce(nonce);
        NextNonce* nextNonce = new NextNonce(nonce, 16);
        chal->setNextNonce(nextNonce);
        setServerNonce(nextNonce->getValueAsBase64());
    }

    return chal;
}