/* checking for GET */ int checkget(char *method,http_request_t *request,http_response_t *response,int newfd) { char *temp = "GET"; char path[MID_SIZE]; memset(path,0, sizeof(path)); strcpy(path,response->resource_path); strcat(path,request->uri); if(strcmp(method,temp)==0) { if(access(path,F_OK)==0) request->method=HTTP_STATUS_OK; else request->method=HTTP_STATUS_NOT_FOUND; } else request->method=HTTP_STATUS_NOT_IMPLEMENTED; passarray(&path,response,request,newfd); return 0; }
static QCA::SymmetricKey passwordKey_( const QString& pass, const QCA::InitializationVector& salt ) { QCA::SecureArray passarray( QByteArray( pass.toUtf8().constData() ) ); QCA::SecureArray passhash( QCA::Hash( PASSWORD_HASH_ALGORITHM ).hash( passarray ) ); return QCA::PBKDF2().makeKey( passhash, salt, KEY_GEN_LENGTH, KEY_GEN_ITERATIONS ); }