Skip to content

Commit

Permalink
chore: Preparing for the SRP client and server
Browse files Browse the repository at this point in the history
  • Loading branch information
macmade committed Nov 9, 2024
1 parent 5d81902 commit be4f676
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 0 deletions.
53 changes: 53 additions & 0 deletions SRPXX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
05818DE02CDFD40300001415 /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05818DD52CDFD40300001415 /* String.cpp */; };
05818DE12CDFD40300001415 /* PBKDF2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05818DCD2CDFD40300001415 /* PBKDF2.cpp */; };
05818DE52CDFD55500001415 /* XSTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05818DE42CDFD55500001415 /* XSTest.framework */; };
05818DE72CDFD62800001415 /* Client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05818DE62CDFD62400001415 /* Client.cpp */; };
05818DE92CDFD63300001415 /* Client.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 05818DE82CDFD62E00001415 /* Client.hpp */; };
05818DF02CDFD65500001415 /* Server.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 05818DEF2CDFD65200001415 /* Server.hpp */; };
05818DF22CDFD66000001415 /* Server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05818DF12CDFD65D00001415 /* Server.cpp */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -53,6 +57,13 @@
remoteGlobalIDString = 056C881118C8B85F006260B3;
remoteInfo = "CF++ Mac Static Library";
};
05818DED2CDFD63800001415 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0544CC6922749F32004A2499 /* XSTest.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 05D526E721A864BC0025CCEB;
remoteInfo = XSTest;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -144,6 +155,10 @@
05818DD52CDFD40300001415 /* String.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; };
05818DE22CDFD4EE00001415 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
05818DE42CDFD55500001415 /* XSTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = XSTest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
05818DE62CDFD62400001415 /* Client.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Client.cpp; sourceTree = "<group>"; };
05818DE82CDFD62E00001415 /* Client.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Client.hpp; sourceTree = "<group>"; };
05818DEF2CDFD65200001415 /* Server.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Server.hpp; sourceTree = "<group>"; };
05818DF12CDFD65D00001415 /* Server.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Server.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -320,11 +335,13 @@
isa = PBXGroup;
children = (
05818D992CDFD3F900001415 /* BigNum.hpp */,
05818DE82CDFD62E00001415 /* Client.hpp */,
05818D9A2CDFD3F900001415 /* Hasher.hpp */,
05818D9B2CDFD3F900001415 /* Integer.hpp */,
05818D9C2CDFD3F900001415 /* PBKDF2.hpp */,
05818D9D2CDFD3F900001415 /* Platform.hpp */,
05818D9E2CDFD3F900001415 /* Random.hpp */,
05818DEF2CDFD65200001415 /* Server.hpp */,
05818D9F2CDFD3F900001415 /* SHA1.hpp */,
05818DA02CDFD3F900001415 /* SHA224.hpp */,
05818DA12CDFD3F900001415 /* SHA256.hpp */,
Expand All @@ -348,9 +365,11 @@
isa = PBXGroup;
children = (
05818DA82CDFD3F900001415 /* BigNum.cpp */,
05818DE62CDFD62400001415 /* Client.cpp */,
05818DA92CDFD3F900001415 /* PBKDF2.cpp */,
05818DAA2CDFD3F900001415 /* Platform.cpp */,
05818DAB2CDFD3F900001415 /* Random.cpp */,
05818DF12CDFD65D00001415 /* Server.cpp */,
05818DAC2CDFD3F900001415 /* SHA1.cpp */,
05818DAD2CDFD3F900001415 /* SHA224.cpp */,
05818DAE2CDFD3F900001415 /* SHA256.cpp */,
Expand Down Expand Up @@ -397,6 +416,14 @@
name = Frameworks;
sourceTree = "<group>";
};
05818DEA2CDFD63800001415 /* Products */ = {
isa = PBXGroup;
children = (
05818DEE2CDFD63800001415 /* XSTest.framework */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand All @@ -406,13 +433,15 @@
files = (
05818DBE2CDFD3F900001415 /* Platform.hpp in Headers */,
05818DBF2CDFD3F900001415 /* SHA384.hpp in Headers */,
05818DF02CDFD65500001415 /* Server.hpp in Headers */,
05818DC02CDFD3F900001415 /* Integer.hpp in Headers */,
05818DC12CDFD3F900001415 /* SHA1.hpp in Headers */,
05818DC22CDFD3F900001415 /* SHA512.hpp in Headers */,
05818DC32CDFD3F900001415 /* Hasher.hpp in Headers */,
05818DC42CDFD3F900001415 /* SRPXX.hpp in Headers */,
05818DC52CDFD3F900001415 /* SHA256.hpp in Headers */,
05818DC62CDFD3F900001415 /* BigNum.hpp in Headers */,
05818DE92CDFD63300001415 /* Client.hpp in Headers */,
05818DC72CDFD3F900001415 /* SHA224.hpp in Headers */,
05818DC82CDFD3F900001415 /* PBKDF2.hpp in Headers */,
05818DC92CDFD3F900001415 /* Random.hpp in Headers */,
Expand Down Expand Up @@ -475,6 +504,7 @@
};
056C881118C8B85F006260B3 = {
DevelopmentTeam = 326Y53CJMD;
LastSwiftMigration = 1610;
ProvisioningStyle = Automatic;
};
};
Expand All @@ -490,6 +520,12 @@
mainGroup = 056C87C518C8B0F8006260B3;
productRefGroup = 056C87CF18C8B0F8006260B3 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 05818DEA2CDFD63800001415 /* Products */;
ProjectRef = 0544CC6922749F32004A2499 /* XSTest.xcodeproj */;
},
);
projectRoot = "";
targets = (
056C881118C8B85F006260B3 /* SRPXX */,
Expand All @@ -498,6 +534,16 @@
};
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
05818DEE2CDFD63800001415 /* XSTest.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = XSTest.framework;
remoteRef = 05818DED2CDFD63800001415 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
056C58BD1B1898FF00C6214A /* Resources */ = {
isa = PBXResourcesBuildPhase;
Expand Down Expand Up @@ -539,7 +585,9 @@
05818DB92CDFD3F900001415 /* SHA224.cpp in Sources */,
05818DBA2CDFD3F900001415 /* SHA256.cpp in Sources */,
05818DBB2CDFD3F900001415 /* SHA1.cpp in Sources */,
05818DE72CDFD62800001415 /* Client.cpp in Sources */,
05818DBC2CDFD3F900001415 /* String.cpp in Sources */,
05818DF22CDFD66000001415 /* Server.cpp in Sources */,
05818DBD2CDFD3F900001415 /* SHA384.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -646,26 +694,31 @@
056C881418C8B85F006260B3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"$(inherited)",
Submodules/BoringSSL/include,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
};
name = Debug;
};
056C881518C8B85F006260B3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"$(inherited)",
Submodules/BoringSSL/include,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand Down
2 changes: 2 additions & 0 deletions SRPXX/include/SRPXX.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@
#include <SRPXX/SHA384.hpp>
#include <SRPXX/SHA512.hpp>
#include <SRPXX/PBKDF2.hpp>
#include <SRPXX/Client.hpp>
#include <SRPXX/Server.hpp>

#endif /* SRPXX_HPP */
50 changes: 50 additions & 0 deletions SRPXX/include/SRPXX/Client.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2024 Jean-David Gadina - www.xs-labs.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/

#ifndef SRPXX_CLIENT_HPP
#define SRPXX_CLIENT_HPP

#include <memory>

namespace SRP
{
class Client
{
public:

Client();
virtual ~Client();

Client( const Client & o ) = delete;
Client & operator =( const Client & o ) = delete;

private:

class IMPL;

std::unique_ptr< IMPL > impl;
};
}

#endif /* SRPXX_CLIENT_HPP */
50 changes: 50 additions & 0 deletions SRPXX/include/SRPXX/Server.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2024 Jean-David Gadina - www.xs-labs.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/

#ifndef SRPXX_SERVER_HPP
#define SRPXX_SERVER_HPP

#include <memory>

namespace SRP
{
class Server
{
public:

Server();
virtual ~Server();

Server( const Server & o ) = delete;
Server & operator =( const Server & o ) = delete;

private:

class IMPL;

std::unique_ptr< IMPL > impl;
};
}

#endif /* SRPXX_SERVER_HPP */
49 changes: 49 additions & 0 deletions SRPXX/source/Client.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2024 Jean-David Gadina - www.xs-labs.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/

#include <SRPXX/Client.hpp>

namespace SRP
{
class Client::IMPL
{
public:

IMPL();
~IMPL();
};

Client::Client():
impl( std::make_unique< IMPL >() )
{}

Client::~Client()
{}

Client::IMPL::IMPL()
{}

Client::IMPL::~IMPL()
{}
}
49 changes: 49 additions & 0 deletions SRPXX/source/Server.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2024 Jean-David Gadina - www.xs-labs.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/

#include <SRPXX/Server.hpp>

namespace SRP
{
class Server::IMPL
{
public:

IMPL();
~IMPL();
};

Server::Server():
impl( std::make_unique< IMPL >() )
{}

Server::~Server()
{}

Server::IMPL::IMPL()
{}

Server::IMPL::~IMPL()
{}
}

0 comments on commit be4f676

Please sign in to comment.