Changed Encryption to use LibSodium instead of OpenSSL, refactored many things and overall improved the code quality and performance with magic.
This commit is contained in:
parent
46ad03a54d
commit
367399f0fd
44 changed files with 2971 additions and 2016 deletions
|
@ -5,8 +5,7 @@
|
|||
enum DatabaseObjects : string
|
||||
{
|
||||
case VARIABLES = 'variables.sql';
|
||||
case ENCRYPTION_RECORDS = 'encryption_records.sql';
|
||||
case RESOLVED_SERVERS = 'resolved_servers.sql';
|
||||
case RESOLVED_DNS_RECORDS = 'resolved_dns_records.sql';
|
||||
|
||||
case REGISTERED_PEERS = 'registered_peers.sql';
|
||||
|
||||
|
@ -24,7 +23,7 @@
|
|||
{
|
||||
return match ($this)
|
||||
{
|
||||
self::VARIABLES, self::ENCRYPTION_RECORDS, self::RESOLVED_SERVERS => 0,
|
||||
self::VARIABLES, self::RESOLVED_DNS_RECORDS => 0,
|
||||
self::REGISTERED_PEERS => 1,
|
||||
self::AUTHENTICATION_PASSWORDS, self::CAPTCHA_IMAGES, self::SESSIONS, self::EXTERNAL_SESSIONS => 2,
|
||||
};
|
||||
|
|
|
@ -7,16 +7,21 @@ enum StandardError : int
|
|||
// Fallback Codes
|
||||
case UNKNOWN = -1;
|
||||
|
||||
// Server/Request Errors
|
||||
case INTERNAL_SERVER_ERROR = -100;
|
||||
case SERVER_UNAVAILABLE = -101;
|
||||
case BAD_REQUEST = -102;
|
||||
case FORBIDDEN = -103;
|
||||
case UNAUTHORIZED = -104;
|
||||
case RESOLUTION_FAILED = -105;
|
||||
case CRYPTOGRAPHIC_ERROR = -106;
|
||||
|
||||
// RPC Errors
|
||||
case RPC_METHOD_NOT_FOUND = -1000;
|
||||
case RPC_INVALID_ARGUMENTS = -1001;
|
||||
|
||||
// Server Errors
|
||||
case INTERNAL_SERVER_ERROR = -2000;
|
||||
case SERVER_UNAVAILABLE = -2001;
|
||||
CASE RPC_BAD_REQUEST = -1002;
|
||||
|
||||
// Client Errors
|
||||
case BAD_REQUEST = -3000;
|
||||
case METHOD_NOT_ALLOWED = -3001;
|
||||
|
||||
// Authentication/Cryptography Errors
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
enum StandardHeaders : string
|
||||
{
|
||||
case REQUEST_TYPE = 'Request-Type';
|
||||
case ERROR_CODE = 'Error-Code';
|
||||
case IDENTIFY_AS = 'Identify-As';
|
||||
case CLIENT_NAME = 'Client-Name';
|
||||
case CLIENT_VERSION = 'Client-Version';
|
||||
case PUBLIC_KEY = 'Public-Key';
|
||||
case SIGNING_PUBLIC_KEY = 'Signing-Public-Key';
|
||||
case ENCRYPTION_PUBLIC_KEY = 'Encryption-Public-Key';
|
||||
|
||||
case SESSION_UUID = 'Session-UUID';
|
||||
case SIGNATURE = 'Signature';
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
|
||||
enum RequestType : string
|
||||
{
|
||||
/**
|
||||
* Represents the action of getting server information (Non-RPC Request)
|
||||
*/
|
||||
case INFO = 'info';
|
||||
|
||||
/**
|
||||
* Represents the action of initiating a session.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue