Init
This commit is contained in:
124
Help/Doxygen/html/da/d67/_two_way_authentication_8cpp.xhtml
Normal file
124
Help/Doxygen/html/da/d67/_two_way_authentication_8cpp.xhtml
Normal file
@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<title>SLikeNet: Source/src/TwoWayAuthentication.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(initResizable);
|
||||
</script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">SLikeNet
|
||||
 <span id="projectnumber">0.1.3</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.2 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
|
||||
</script>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="../../index.xhtml"><span>Main Page</span></a></li>
|
||||
<li><a href="../../pages.xhtml"><span>Related Pages</span></a></li>
|
||||
<li><a href="../../modules.xhtml"><span>Modules</span></a></li>
|
||||
<li><a href="../../namespaces.xhtml"><span>Namespaces</span></a></li>
|
||||
<li><a href="../../annotated.xhtml"><span>Classes</span></a></li>
|
||||
<li class="current"><a href="../../files.xhtml"><span>Files</span></a></li>
|
||||
<li>
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="../../search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="../../files.xhtml"><span>File List</span></a></li>
|
||||
<li><a href="../../globals.xhtml"><span>File Members</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){initNavTree('da/d67/_two_way_authentication_8cpp.xhtml','../../');});
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(12)"><span class="SelectionMark"> </span>Pages</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">TwoWayAuthentication.cpp File Reference</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock"><code>#include "<a class="el" href="../../de/ddb/_native_feature_includes_8h_source.xhtml">slikenet/NativeFeatureIncludes.h</a>"</code><br/>
|
||||
</div>
|
||||
<p><a href="../../da/d67/_two_way_authentication_8cpp_source.xhtml">Go to the source code of this file.</a></p>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_74389ed8173ad57b461b9d623a1f3867.xhtml">Source</a></li><li class="navelem"><a class="el" href="../../dir_d1eb22c2ecfd8b50f59e9cbaf8260105.xhtml">src</a></li><li class="navelem"><a class="el" href="../../da/d67/_two_way_authentication_8cpp.xhtml">TwoWayAuthentication.cpp</a></li>
|
||||
<li class="footer">Generated on Wed Aug 14 2019 22:09:48 for SLikeNet by
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,574 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<title>SLikeNet: Source/src/TwoWayAuthentication.cpp Source File</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(initResizable);
|
||||
</script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">SLikeNet
|
||||
 <span id="projectnumber">0.1.3</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.2 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
|
||||
</script>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="../../index.xhtml"><span>Main Page</span></a></li>
|
||||
<li><a href="../../pages.xhtml"><span>Related Pages</span></a></li>
|
||||
<li><a href="../../modules.xhtml"><span>Modules</span></a></li>
|
||||
<li><a href="../../namespaces.xhtml"><span>Namespaces</span></a></li>
|
||||
<li><a href="../../annotated.xhtml"><span>Classes</span></a></li>
|
||||
<li class="current"><a href="../../files.xhtml"><span>Files</span></a></li>
|
||||
<li>
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="../../search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="../../files.xhtml"><span>File List</span></a></li>
|
||||
<li><a href="../../globals.xhtml"><span>File Members</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){initNavTree('da/d67/_two_way_authentication_8cpp_source.xhtml','../../');});
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(12)"><span class="SelectionMark"> </span>Pages</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">TwoWayAuthentication.cpp</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../da/d67/_two_way_authentication_8cpp.xhtml">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
|
||||
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Original work: Copyright (c) 2014, Oculus VR, Inc.</span></div>
|
||||
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * All rights reserved.</span></div>
|
||||
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * This source code is licensed under the BSD-style license found in the</span></div>
|
||||
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * RakNet License.txt file in the licenses directory of this source tree. An additional grant </span></div>
|
||||
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * of patent rights can be found in the RakNet Patents.txt file in the same directory.</span></div>
|
||||
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt)</span></div>
|
||||
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style</span></div>
|
||||
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * license found in the license.txt file in the root directory of this source tree.</span></div>
|
||||
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> */</span></div>
|
||||
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div>
|
||||
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="../../de/ddb/_native_feature_includes_8h.xhtml">slikenet/NativeFeatureIncludes.h</a>"</span></div>
|
||||
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#if _RAKNET_SUPPORT_TwoWayAuthentication==1</span></div>
|
||||
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor"></span></div>
|
||||
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml" title="Implements two way authentication.">slikenet/TwoWayAuthentication.h</a>"</span></div>
|
||||
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="../../d7/d10/_rand_8h.xhtml" title="[Internal] Random number generator">slikenet/Rand.h</a>"</span></div>
|
||||
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="../../d6/d76/_get_time_8h.xhtml" title="Returns the value from QueryPerformanceCounter. This is the function RakNet uses to represent time...">slikenet/GetTime.h</a>"</span></div>
|
||||
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "<a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml" title="All the message identifiers used by RakNet. Message identifiers comprise the first byte of any messag...">slikenet/MessageIdentifiers.h</a>"</span></div>
|
||||
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="../../d7/dc3/_bit_stream_8h.xhtml" title="This class allows you to write and read native types as a string of bits.">slikenet/BitStream.h</a>"</span></div>
|
||||
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "<a class="code" href="../../dd/d85/peerinterface_8h.xhtml" title="An interface for RakPeer. Simply contains all user functions as pure virtuals.">slikenet/peerinterface.h</a>"</span></div>
|
||||
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#if LIBCAT_SECURITY==1</span></div>
|
||||
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor"></span><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> HASH_BITS = 256;</div>
|
||||
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> HASH_BYTES = HASH_BITS / 8;</div>
|
||||
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> STRENGTHENING_FACTOR = 256;</div>
|
||||
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">// If building a RakNet DLL, be sure to tweak the CAT_EXPORT macro meaning</span></div>
|
||||
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#if !defined(_RAKNET_LIB) && defined(_RAKNET_DLL)</span></div>
|
||||
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor"></span><span class="preprocessor"># define CAT_BUILD_DLL</span></div>
|
||||
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor"></span><span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor"></span><span class="preprocessor"># define CAT_NEUTER_EXPORT</span></div>
|
||||
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor"></span><span class="preprocessor">#include <cat/crypt/hash/Skein.hpp></span></div>
|
||||
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor"></span></div>
|
||||
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">using namespace </span>SLNet;</div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">enum</span> NegotiationIdentifiers</div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> {</div>
|
||||
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  ID_NONCE_REQUEST,</div>
|
||||
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  ID_NONCE_REPLY,</div>
|
||||
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  ID_HASHED_NONCE_AND_PASSWORD,</div>
|
||||
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> };</div>
|
||||
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a9d69f4b7e6f2167fda3732b70ebbb6ff">TwoWayAuthentication::NonceGenerator::NonceGenerator</a>() {<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#ac9915da4f02b9b0e936106883622b461">nextRequestId</a>=0;}</div>
|
||||
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a2c7cb0a60a136c7badd20976719b883a">TwoWayAuthentication::NonceGenerator::~NonceGenerator</a>()</div>
|
||||
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> {</div>
|
||||
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a0ed9bcd3686373d418d71ce91c04d9b0" title="Free all memory.">Clear</a>();</div>
|
||||
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> }</div>
|
||||
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a03d185542785ad825da632c8e460f215">TwoWayAuthentication::NonceGenerator::GetNonce</a>(<span class="keywordtype">char</span> nonce[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#aaa86357a26d52aae1bbb4337f804ff62">TWO_WAY_AUTHENTICATION_NONCE_LENGTH</a>], <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> *requestId, <a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml">SLNet::AddressOrGUID</a> remoteSystem)</div>
|
||||
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> {</div>
|
||||
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#d8/dc2/struct_s_l_net_1_1_two_way_authentication_1_1_nonce_and_remote_system_request">TwoWayAuthentication::NonceAndRemoteSystemRequest</a> *narsr = SLNet::OP_NEW<TwoWayAuthentication::NonceAndRemoteSystemRequest>(<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  narsr-><a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#aa93ad0f94635f877fe5b426639f88dd5">remoteSystem</a>=remoteSystem;</div>
|
||||
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  GenerateNonce(narsr-><a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a461de4e62ef3008ac0420af1de70dc9e">nonce</a>);</div>
|
||||
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  narsr-><a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a168de9a145b811e62a81e54c645ccd46">requestId</a>=nextRequestId++;</div>
|
||||
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  *requestId=narsr-><a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a168de9a145b811e62a81e54c645ccd46">requestId</a>;</div>
|
||||
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  memcpy(nonce,narsr-><a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a461de4e62ef3008ac0420af1de70dc9e">nonce</a>,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  narsr-><a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a48ca19e6389a22a4549bf63d0935838d">whenGenerated</a>= <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a2de556bb780580b7b7f07e99e382818d">SLNet::GetTime</a>();</div>
|
||||
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  generatedNonces.Push(narsr,<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> }</div>
|
||||
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a023d0ac76909034c9ec9fca36c7a4dfc">TwoWayAuthentication::NonceGenerator::GenerateNonce</a>(<span class="keywordtype">char</span> nonce[TWO_WAY_AUTHENTICATION_NONCE_LENGTH])</div>
|
||||
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> {</div>
|
||||
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="../../da/d82/_rand_8cpp.xhtml#ade83f21ad5a606f79932ba432d97ced7">fillBufferMT</a>(nonce,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> }</div>
|
||||
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="keywordtype">bool</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a0004c74c2fd750ec0e09886697b7f37f">TwoWayAuthentication::NonceGenerator::GetNonceById</a>(<span class="keywordtype">char</span> nonce[TWO_WAY_AUTHENTICATION_NONCE_LENGTH], <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> requestId, <a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml">SLNet::AddressOrGUID</a> remoteSystem, <span class="keywordtype">bool</span> popIfFound)</div>
|
||||
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> {</div>
|
||||
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i;</div>
|
||||
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">for</span> (i=0; i < generatedNonces.Size(); i++)</div>
|
||||
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  {</div>
|
||||
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordflow">if</span> (generatedNonces[i]->requestId==requestId)</div>
|
||||
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  {</div>
|
||||
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordflow">if</span> (remoteSystem==generatedNonces[i]->remoteSystem)</div>
|
||||
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  {</div>
|
||||
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  memcpy(nonce,generatedNonces[i]->nonce,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">if</span> (popIfFound)</div>
|
||||
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  {</div>
|
||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a79772d09451f784e87bec85694fad1ed">SLNet::OP_DELETE</a>(generatedNonces[i],<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  generatedNonces.RemoveAtIndex(i);</div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  }</div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  }</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  {</div>
|
||||
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  }</div>
|
||||
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  }</div>
|
||||
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  }</div>
|
||||
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> }</div>
|
||||
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#aa737dd83942e38fe9ba0dee12d077f7d">TwoWayAuthentication::NonceGenerator::Clear</a>(<span class="keywordtype">void</span>)</div>
|
||||
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> {</div>
|
||||
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i;</div>
|
||||
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">for</span> (i=0; i < generatedNonces.Size(); i++)</div>
|
||||
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a79772d09451f784e87bec85694fad1ed">SLNet::OP_DELETE</a>(generatedNonces[i],<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  generatedNonces.Clear(<span class="keyword">true</span>,<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> }</div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#af066ffb6fb4b0e8ea7081aa6ec6a9ebf">TwoWayAuthentication::NonceGenerator::ClearByAddress</a>(<a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml">SLNet::AddressOrGUID</a> remoteSystem)</div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> {</div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0;</div>
|
||||
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">while</span> (i < generatedNonces.Size())</div>
|
||||
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  {</div>
|
||||
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">if</span> (generatedNonces[i]->remoteSystem==remoteSystem)</div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  {</div>
|
||||
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a79772d09451f784e87bec85694fad1ed">SLNet::OP_DELETE</a>(generatedNonces[i],<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  generatedNonces.RemoveAtIndex(i);</div>
|
||||
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  }</div>
|
||||
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  {</div>
|
||||
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  i++;</div>
|
||||
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  }</div>
|
||||
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  }</div>
|
||||
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> }</div>
|
||||
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a01a95b20e19a2da0713c08741d1cc5ea">TwoWayAuthentication::NonceGenerator::Update</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a7223b62c1b67121db1d975f2ab9b74c7">SLNet::Time</a> curTime)</div>
|
||||
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> {</div>
|
||||
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordflow">if</span> (generatedNonces.Size()>0 && <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#ae99a418b0377902ee85309774e03a7de" title="a > b?">GreaterThan</a>(curTime-5000, generatedNonces[0]->whenGenerated))</div>
|
||||
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  {</div>
|
||||
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a79772d09451f784e87bec85694fad1ed">SLNet::OP_DELETE</a>(generatedNonces[0], <a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  generatedNonces.RemoveAtIndex(0);</div>
|
||||
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  }</div>
|
||||
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> }</div>
|
||||
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a1bbca4ee3edb909fde81741f7cdc763d">TwoWayAuthentication::TwoWayAuthentication</a>()</div>
|
||||
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> {</div>
|
||||
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a766fc0e8387692ea9677f5058c1f3d64">whenLastTimeoutCheck</a>= <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a2de556bb780580b7b7f07e99e382818d">SLNet::GetTime</a>();</div>
|
||||
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="../../da/d82/_rand_8cpp.xhtml#a86290618479835cad5f671ed697300d2">seedMT</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a4772a177cb3fcb5d9e699a6670c3fb8a">SLNet::GetTimeMS</a>());</div>
|
||||
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> }</div>
|
||||
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#afe3e541120aea472dfff72d096a25ab4">TwoWayAuthentication::~TwoWayAuthentication</a>()</div>
|
||||
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> {</div>
|
||||
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a0ed9bcd3686373d418d71ce91c04d9b0" title="Free all memory.">Clear</a>();</div>
|
||||
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> }</div>
|
||||
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">bool</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#ab0916b11ff6b6a4049340167b293f736" title="Adds a password to the list of passwords the system will accept.">TwoWayAuthentication::AddPassword</a>(<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> identifier, <a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> password)</div>
|
||||
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> {</div>
|
||||
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">if</span> (password.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#a83a4f2762a85a1e4704db0f7ac2c0abe" title="Returns if the string is empty. Also, C_String() would return "".">IsEmpty</a>())</div>
|
||||
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordflow">if</span> (identifier.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#a83a4f2762a85a1e4704db0f7ac2c0abe" title="Returns if the string is empty. Also, C_String() would return "".">IsEmpty</a>())</div>
|
||||
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div>
|
||||
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordflow">if</span> (password==identifier)</div>
|
||||
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Insecure</span></div>
|
||||
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div>
|
||||
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">if</span> (<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#af31d2ff3160e0d7e0275faf0a2e35fb7">GetIndexOf</a>(identifier.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#ac661bded7f8850f8cf7bbcad8406d3e4" title="Same as std::string::c_str.">C_String</a>()).IsInvalid()==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// This identifier already in use</span></div>
|
||||
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div>
|
||||
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#a1cd78525c3b53c60fc5a6f1f722d53f2">Push</a>(identifier, password,<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span> }</div>
|
||||
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="keywordtype">bool</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a24cac4a408b23ee80c8a284b6242806f" title="Challenge another system for the specified identifier.">TwoWayAuthentication::Challenge</a>(<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> identifier, <a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml">AddressOrGUID</a> remoteSystem)</div>
|
||||
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> {</div>
|
||||
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml">DataStructures::HashIndex</a> skhi = <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#af31d2ff3160e0d7e0275faf0a2e35fb7">GetIndexOf</a>(identifier.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#ac661bded7f8850f8cf7bbcad8406d3e4" title="Same as std::string::c_str.">C_String</a>());</div>
|
||||
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="keywordflow">if</span> (skhi.<a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml#a5d5347b85316db1181a65fc05a388460">IsInvalid</a>())</div>
|
||||
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> </div>
|
||||
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsOut;</div>
|
||||
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)<a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3a867828d13631463d58bfdaf22cb106e0">ID_TWO_WAY_AUTHENTICATION_NEGOTIATION</a>);</div>
|
||||
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)ID_NONCE_REQUEST);</div>
|
||||
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#aa9c79c0d16ece39114231d680190d39a">SendUnified</a>(&bsOut,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#a659378374e516180f93640c79f59705cacb1785f11dd02aa7f5d164fb314c594e">HIGH_PRIORITY</a>,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#ae41fa01235e99dced384d137fa874a7eaff2d39b163bcf3e142744962bfb0849f">RELIABLE_ORDERED</a>,0,remoteSystem,<span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div>
|
||||
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  PendingChallenge pc;</div>
|
||||
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  pc.identifier=identifier;</div>
|
||||
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  pc.remoteSystem=remoteSystem;</div>
|
||||
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  pc.time= <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a2de556bb780580b7b7f07e99e382818d">SLNet::GetTime</a>();</div>
|
||||
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  pc.sentHash=<span class="keyword">false</span>;</div>
|
||||
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#ae564a88f3367a786777694e778a4500d">Push</a>(pc,<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> </div>
|
||||
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> }</div>
|
||||
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a1c6a65a3f68732e89304be63d7f554f3" title="Update is called every time a packet is checked for .">TwoWayAuthentication::Update</a>(<span class="keywordtype">void</span>)</div>
|
||||
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span> {</div>
|
||||
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a7223b62c1b67121db1d975f2ab9b74c7">SLNet::Time</a> curTime = <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a2de556bb780580b7b7f07e99e382818d">SLNet::GetTime</a>();</div>
|
||||
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a36e61759a6d97672877709774c4a710c">nonceGenerator</a>.<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a01a95b20e19a2da0713c08741d1cc5ea">Update</a>(curTime);</div>
|
||||
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordflow">if</span> (<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#ae99a418b0377902ee85309774e03a7de" title="a > b?">GreaterThan</a>(curTime - <a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a75d76cdac8766b04974dd1161372a22b">CHALLENGE_MINIMUM_TIMEOUT</a>, <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a766fc0e8387692ea9677f5058c1f3d64">whenLastTimeoutCheck</a>))</div>
|
||||
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  {</div>
|
||||
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">while</span> (<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#ae2aec093c82f780558c23f8ae9f296b8">Size</a>() && <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#ae99a418b0377902ee85309774e03a7de" title="a > b?">GreaterThan</a>(curTime - <a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a75d76cdac8766b04974dd1161372a22b">CHALLENGE_MINIMUM_TIMEOUT</a>, <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#a5e9c9de11d2dd84320d2f7c9408b80b1">Peek</a>().<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#acb6dd0eea6e100b38eadc7f47ae0c0a0">time</a>))</div>
|
||||
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  {</div>
|
||||
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  PendingChallenge pc = <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#a25272370e684388afd807c5369e4ef87">Pop</a>();</div>
|
||||
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span> </div>
|
||||
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="comment">// Tell the user about the timeout</span></div>
|
||||
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a9bf3b18bd759234c97faf220aa47c6a5">PushToUser</a>(<a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3ab22405f8b40d04f6eebfb04a468768c5">ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_TIMEOUT</a>, pc.identifier, pc.remoteSystem); </div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  }</div>
|
||||
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div>
|
||||
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a766fc0e8387692ea9677f5058c1f3d64">whenLastTimeoutCheck</a>=curTime+<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a75d76cdac8766b04974dd1161372a22b">CHALLENGE_MINIMUM_TIMEOUT</a>;</div>
|
||||
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  }</div>
|
||||
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> }</div>
|
||||
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#ga5c8f613a7c294e0b96deccbdabc38f18">PluginReceiveResult</a> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a30510f6274eb21d4081d0935d5e09b0f">TwoWayAuthentication::OnReceive</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#d8/d23/struct_s_l_net_1_1_packet" title="This represents a user message from another system.">Packet</a> *packet)</div>
|
||||
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span> {</div>
|
||||
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keywordflow">switch</span> (packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>[0])</div>
|
||||
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  {</div>
|
||||
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">case</span> ID_TWO_WAY_AUTHENTICATION_NEGOTIATION:</div>
|
||||
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  {</div>
|
||||
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">if</span> (packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a75dfd0a23cc4c14dd338caedabe19341" title="The length of the data in bytes.">length</a>>=<span class="keyword">sizeof</span>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)*2)</div>
|
||||
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  {</div>
|
||||
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keywordflow">switch</span> (packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>[<span class="keyword">sizeof</span>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)])</div>
|
||||
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  {</div>
|
||||
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">case</span> ID_NONCE_REQUEST:</div>
|
||||
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  {</div>
|
||||
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a8d60c2c3f15c2e198e9162dfe615a430">OnNonceRequest</a>(packet);</div>
|
||||
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  }</div>
|
||||
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordflow">case</span> ID_NONCE_REPLY:</div>
|
||||
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  {</div>
|
||||
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#ab809626888e294ced64b04a826c2145e">OnNonceReply</a>(packet);</div>
|
||||
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  }</div>
|
||||
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">case</span> ID_HASHED_NONCE_AND_PASSWORD:</div>
|
||||
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  {</div>
|
||||
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keywordflow">return</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a49704c0e457bd706a975bb750f158364">OnHashedNonceAndPassword</a>(packet);</div>
|
||||
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  }</div>
|
||||
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  }</div>
|
||||
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  }</div>
|
||||
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">return</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#gga5c8f613a7c294e0b96deccbdabc38f18a9f27ed7ccb7513dceb7ed4da3d99a1bf" title="The plugin used this message and it shouldn't be given to the user.">RR_STOP_PROCESSING_AND_DEALLOCATE</a>;</div>
|
||||
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  }</div>
|
||||
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordflow">case</span> <a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3a3b03ba34163c20d4a3918da7baf9d99c">ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_FAILURE</a>:</div>
|
||||
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordflow">case</span> <a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3a717135e1448a14fd201931c450b7cd1a">ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_SUCCESS</a>:</div>
|
||||
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  {</div>
|
||||
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordflow">if</span> (packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a4a736945115119681c77e168346988c4">wasGeneratedLocally</a>==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  {</div>
|
||||
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#ac749a802cdc9829e011b756d527c0683">OnPasswordResult</a>(packet);</div>
|
||||
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">return</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#gga5c8f613a7c294e0b96deccbdabc38f18a9f27ed7ccb7513dceb7ed4da3d99a1bf" title="The plugin used this message and it shouldn't be given to the user.">RR_STOP_PROCESSING_AND_DEALLOCATE</a>;</div>
|
||||
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  }</div>
|
||||
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div>
|
||||
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="comment">// These should only be generated locally</span></div>
|
||||
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">case</span> <a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3ac172bba552038ffc2d2558501c795bc2">ID_TWO_WAY_AUTHENTICATION_INCOMING_CHALLENGE_SUCCESS</a>:</div>
|
||||
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="keywordflow">case</span> <a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3a316f94a26aafc229ef40bd2c7f9879f8">ID_TWO_WAY_AUTHENTICATION_INCOMING_CHALLENGE_FAILURE</a>:</div>
|
||||
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">case</span> <a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3ab22405f8b40d04f6eebfb04a468768c5">ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_TIMEOUT</a>:</div>
|
||||
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keywordflow">if</span> (packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a4a736945115119681c77e168346988c4">wasGeneratedLocally</a>==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">return</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#gga5c8f613a7c294e0b96deccbdabc38f18a9f27ed7ccb7513dceb7ed4da3d99a1bf" title="The plugin used this message and it shouldn't be given to the user.">RR_STOP_PROCESSING_AND_DEALLOCATE</a>;</div>
|
||||
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  }</div>
|
||||
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  </div>
|
||||
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keywordflow">return</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#gga5c8f613a7c294e0b96deccbdabc38f18a5b5a476b87be78212057efd5535345d4" title="This message will be processed by other plugins, and at last by the user.">RR_CONTINUE_PROCESSING</a>;</div>
|
||||
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> }</div>
|
||||
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a63b9ab36e576ffbf94973a395a130936" title="Called when RakPeer is shutdown.">TwoWayAuthentication::OnRakPeerShutdown</a>(<span class="keywordtype">void</span>)</div>
|
||||
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span> {</div>
|
||||
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a0ed9bcd3686373d418d71ce91c04d9b0" title="Free all memory.">Clear</a>();</div>
|
||||
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span> }</div>
|
||||
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a1eeb43d6ddab0645187d77c0ba151d33">TwoWayAuthentication::OnClosedConnection</a>(<span class="keyword">const</span> <a class="code" href="../../d8/dbe/struct_s_l_net_1_1_system_address.xhtml" title="Network address for a system.">SystemAddress</a> &systemAddress, <a class="code" href="../../dd/d3f/struct_s_l_net_1_1_rak_net_g_u_i_d.xhtml">RakNetGUID</a> rakNetGUID, <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#ga4d3ac5ca8821fadad6d22d0267e06803">PI2_LostConnectionReason</a> lostConnectionReason )</div>
|
||||
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span> {</div>
|
||||
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  (void) lostConnectionReason;</div>
|
||||
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span> </div>
|
||||
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="comment">// Remove from pending challenges</span></div>
|
||||
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0;</div>
|
||||
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  <span class="keywordflow">while</span> (i < <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#ae2aec093c82f780558c23f8ae9f296b8">Size</a>())</div>
|
||||
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  {</div>
|
||||
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordflow">if</span> ((rakNetGUID!=<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a242c86300509ec068e5e2ea534bbba51">UNASSIGNED_RAKNET_GUID</a> && <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].remoteSystem.<a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml#a586cd1e6fa1a832ad3e584779ea88d80">rakNetGuid</a>==rakNetGUID) ||</div>
|
||||
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  (systemAddress!=<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#acea7714c995aae0e1feaf79c9e7f073d" title="Index of an invalid SystemAddress.">UNASSIGNED_SYSTEM_ADDRESS</a> && <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].remoteSystem.systemAddress==systemAddress))</div>
|
||||
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  {</div>
|
||||
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#a8be7c3107161bb2ad869a9a6bb60605a">RemoveAtIndex</a>(i);</div>
|
||||
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  }</div>
|
||||
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  {</div>
|
||||
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  i++;</div>
|
||||
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  }</div>
|
||||
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  }</div>
|
||||
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keywordflow">if</span> (rakNetGUID!=<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a242c86300509ec068e5e2ea534bbba51">UNASSIGNED_RAKNET_GUID</a>)</div>
|
||||
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a36e61759a6d97672877709774c4a710c">nonceGenerator</a>.<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#af066ffb6fb4b0e8ea7081aa6ec6a9ebf">ClearByAddress</a>(rakNetGUID);</div>
|
||||
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a36e61759a6d97672877709774c4a710c">nonceGenerator</a>.<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#af066ffb6fb4b0e8ea7081aa6ec6a9ebf">ClearByAddress</a>(systemAddress);</div>
|
||||
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span> }</div>
|
||||
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a0ed9bcd3686373d418d71ce91c04d9b0" title="Free all memory.">TwoWayAuthentication::Clear</a>(<span class="keywordtype">void</span>)</div>
|
||||
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span> {</div>
|
||||
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#a481276f70b05ecba8138cd67e51509ec">Clear</a>(<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#adcbf7b437513650734419bd55f736276" title="Clear the list.">Clear</a>(<a class="code" href="../../d8/db0/defines_8h.xhtml#a8661ec2137eef33a8cd0cd618a748871">_FILE_AND_LINE_</a>);</div>
|
||||
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a36e61759a6d97672877709774c4a710c">nonceGenerator</a>.<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#aa737dd83942e38fe9ba0dee12d077f7d">Clear</a>();</div>
|
||||
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span> }</div>
|
||||
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a9bf3b18bd759234c97faf220aa47c6a5">TwoWayAuthentication::PushToUser</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a> messageId, <a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> password, <a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml">SLNet::AddressOrGUID</a> remoteSystem)</div>
|
||||
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span> {</div>
|
||||
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> output;</div>
|
||||
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  output.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>(messageId);</div>
|
||||
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keywordflow">if</span> (password.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#a83a4f2762a85a1e4704db0f7ac2c0abe" title="Returns if the string is empty. Also, C_String() would return "".">IsEmpty</a>()==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  output.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>(password);</div>
|
||||
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#d8/d23/struct_s_l_net_1_1_packet" title="This represents a user message from another system.">Packet</a> *p = <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#aed235e7933ca7f30448eb9c91cefab63">AllocatePacketUnified</a>(output.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a48740002683b46b00cbb97b8f7d0710e" title="Returns the length in bytes of the stream.">GetNumberOfBytesUsed</a>());</div>
|
||||
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  p-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5c9d18515892239712a5d8fcb46c4245" title="The system that send this packet.">systemAddress</a>=remoteSystem.<a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml#a4d7090b1b5269c293f58fee1da43e098">systemAddress</a>;</div>
|
||||
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  p-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5c9d18515892239712a5d8fcb46c4245" title="The system that send this packet.">systemAddress</a>.<a class="code" href="../../d8/dbe/struct_s_l_net_1_1_system_address.xhtml#aac702cdf872b7c57376b2e379845c150">systemIndex</a>=(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aaebbed028894590d770e7fcf8518c441">SystemIndex</a>)-1;</div>
|
||||
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  p-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a4f42e82893aff6aade8a45c79d1b8fd3">guid</a>=remoteSystem.<a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml#a586cd1e6fa1a832ad3e584779ea88d80">rakNetGuid</a>;</div>
|
||||
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  p-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a4a736945115119681c77e168346988c4">wasGeneratedLocally</a>=<span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  memcpy(p-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>, output.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a7b4099386f6f116f0978b00ead160a0d">GetData</a>(), output.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a48740002683b46b00cbb97b8f7d0710e" title="Returns the length in bytes of the stream.">GetNumberOfBytesUsed</a>());</div>
|
||||
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#adac8deadf450a4e1d69c11b1db588bec">rakPeerInterface</a>-><a class="code" href="../../da/d27/class_s_l_net_1_1_rak_peer_interface.xhtml#a55e4b5cdc35701904e451e81ff237d08">PushBackPacket</a>(p, <span class="keyword">true</span>);</div>
|
||||
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span> }</div>
|
||||
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a8d60c2c3f15c2e198e9162dfe615a430">TwoWayAuthentication::OnNonceRequest</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#d8/d23/struct_s_l_net_1_1_packet" title="This represents a user message from another system.">Packet</a> *packet)</div>
|
||||
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span> {</div>
|
||||
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsIn(packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>, packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a75dfd0a23cc4c14dd338caedabe19341" title="The length of the data in bytes.">length</a>, <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  bsIn.IgnoreBytes(<span class="keyword">sizeof</span>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)*2);</div>
|
||||
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div>
|
||||
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keywordtype">char</span> nonce[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#aaa86357a26d52aae1bbb4337f804ff62">TWO_WAY_AUTHENTICATION_NONCE_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> requestId;</div>
|
||||
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a36e61759a6d97672877709774c4a710c">nonceGenerator</a>.<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a03d185542785ad825da632c8e460f215">GetNonce</a>(nonce,&requestId,packet);</div>
|
||||
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span> </div>
|
||||
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsOut;</div>
|
||||
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)ID_TWO_WAY_AUTHENTICATION_NEGOTIATION);</div>
|
||||
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)ID_NONCE_REPLY);</div>
|
||||
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>(requestId);</div>
|
||||
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#af777083a659116082f109ccd9c8639f5" title="Align the bitstream to the byte boundary and then write the specified number of bits.">WriteAlignedBytes</a>((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) nonce,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#aa9c79c0d16ece39114231d680190d39a">SendUnified</a>(&bsOut,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#a659378374e516180f93640c79f59705cacb1785f11dd02aa7f5d164fb314c594e">HIGH_PRIORITY</a>,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#ae41fa01235e99dced384d137fa874a7eaff2d39b163bcf3e142744962bfb0849f">RELIABLE_ORDERED</a>,0,packet,<span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span> }</div>
|
||||
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#ab809626888e294ced64b04a826c2145e">TwoWayAuthentication::OnNonceReply</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#d8/d23/struct_s_l_net_1_1_packet" title="This represents a user message from another system.">Packet</a> *packet)</div>
|
||||
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span> {</div>
|
||||
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsIn(packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>, packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a75dfd0a23cc4c14dd338caedabe19341" title="The length of the data in bytes.">length</a>, <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  bsIn.IgnoreBytes(<span class="keyword">sizeof</span>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)*2);</div>
|
||||
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span> </div>
|
||||
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <span class="keywordtype">char</span> thierNonce[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#aaa86357a26d52aae1bbb4337f804ff62">TWO_WAY_AUTHENTICATION_NONCE_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> requestId;</div>
|
||||
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  bsIn.Read(requestId);</div>
|
||||
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  bsIn.ReadAlignedBytes((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) thierNonce,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span> </div>
|
||||
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="comment">// Lookup one of the negotiations for this guid/system address</span></div>
|
||||
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml">AddressOrGUID</a> aog(packet);</div>
|
||||
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i;</div>
|
||||
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="keywordflow">for</span> (i=0; i < <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#ae2aec093c82f780558c23f8ae9f296b8">Size</a>(); i++)</div>
|
||||
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  {</div>
|
||||
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordflow">if</span> (<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].remoteSystem==aog && <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].sentHash==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  {</div>
|
||||
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].sentHash=<span class="keyword">true</span>;</div>
|
||||
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> </div>
|
||||
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="comment">// Get the password for this identifier</span></div>
|
||||
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml">DataStructures::HashIndex</a> skhi = <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#af31d2ff3160e0d7e0275faf0a2e35fb7">GetIndexOf</a>(<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].identifier.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#ac661bded7f8850f8cf7bbcad8406d3e4" title="Same as std::string::c_str.">C_String</a>());</div>
|
||||
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="keywordflow">if</span> (skhi.<a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml#a5d5347b85316db1181a65fc05a388460">IsInvalid</a>()==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  {</div>
|
||||
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> password = <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#a5fec5e2f5f479ddeebefe9a0ff1c50e4">ItemAtIndex</a>(skhi);</div>
|
||||
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span> </div>
|
||||
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="comment">// Hash their nonce with password and reply</span></div>
|
||||
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <span class="keywordtype">char</span> hashedNonceAndPw[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a6b28e2a151770a5447d9dfb73250f42a">Hash</a>(thierNonce, password, hashedNonceAndPw);</div>
|
||||
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span> </div>
|
||||
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  <span class="comment">// Send</span></div>
|
||||
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsOut;</div>
|
||||
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)ID_TWO_WAY_AUTHENTICATION_NEGOTIATION);</div>
|
||||
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)ID_HASHED_NONCE_AND_PASSWORD);</div>
|
||||
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>(requestId);</div>
|
||||
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>(<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].identifier); <span class="comment">// Identifier helps the other system lookup the password quickly.</span></div>
|
||||
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#af777083a659116082f109ccd9c8639f5" title="Align the bitstream to the byte boundary and then write the specified number of bits.">WriteAlignedBytes</a>((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) hashedNonceAndPw,<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>);</div>
|
||||
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#aa9c79c0d16ece39114231d680190d39a">SendUnified</a>(&bsOut,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#a659378374e516180f93640c79f59705cacb1785f11dd02aa7f5d164fb314c594e">HIGH_PRIORITY</a>,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#ae41fa01235e99dced384d137fa874a7eaff2d39b163bcf3e142744962bfb0849f">RELIABLE_ORDERED</a>,0,packet,<span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  }</div>
|
||||
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span> </div>
|
||||
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  }</div>
|
||||
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  }</div>
|
||||
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span> }</div>
|
||||
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#ga5c8f613a7c294e0b96deccbdabc38f18">PluginReceiveResult</a> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a49704c0e457bd706a975bb750f158364">TwoWayAuthentication::OnHashedNonceAndPassword</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#d8/d23/struct_s_l_net_1_1_packet" title="This represents a user message from another system.">Packet</a> *packet)</div>
|
||||
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span> {</div>
|
||||
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsIn(packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>, packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a75dfd0a23cc4c14dd338caedabe19341" title="The length of the data in bytes.">length</a>, <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  bsIn.IgnoreBytes(<span class="keyword">sizeof</span>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)*2);</div>
|
||||
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span> </div>
|
||||
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="keywordtype">char</span> remoteHashedNonceAndPw[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> requestId;</div>
|
||||
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  bsIn.Read(requestId);</div>
|
||||
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  <a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> passwordIdentifier;</div>
|
||||
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  bsIn.Read(passwordIdentifier);</div>
|
||||
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  bsIn.ReadAlignedBytes((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) remoteHashedNonceAndPw,<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>);</div>
|
||||
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> </div>
|
||||
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="comment">// Look up used nonce from requestId</span></div>
|
||||
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="keywordtype">char</span> usedNonce[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#aaa86357a26d52aae1bbb4337f804ff62">TWO_WAY_AUTHENTICATION_NONCE_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  <span class="keywordflow">if</span> (<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a36e61759a6d97672877709774c4a710c">nonceGenerator</a>.<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a0004c74c2fd750ec0e09886697b7f37f">GetNonceById</a>(usedNonce, requestId, packet, <span class="keyword">true</span>)==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="keywordflow">return</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#gga5c8f613a7c294e0b96deccbdabc38f18a9f27ed7ccb7513dceb7ed4da3d99a1bf" title="The plugin used this message and it shouldn't be given to the user.">RR_STOP_PROCESSING_AND_DEALLOCATE</a>;</div>
|
||||
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span> </div>
|
||||
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml">DataStructures::HashIndex</a> skhi = <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#af31d2ff3160e0d7e0275faf0a2e35fb7">GetIndexOf</a>(passwordIdentifier.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#ac661bded7f8850f8cf7bbcad8406d3e4" title="Same as std::string::c_str.">C_String</a>());</div>
|
||||
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="keywordflow">if</span> (skhi.<a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml#a5d5347b85316db1181a65fc05a388460">IsInvalid</a>()==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  {</div>
|
||||
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  <span class="keywordtype">char</span> hashedThisNonceAndPw[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a6b28e2a151770a5447d9dfb73250f42a">Hash</a>(usedNonce, <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#a5fec5e2f5f479ddeebefe9a0ff1c50e4">ItemAtIndex</a>(skhi), hashedThisNonceAndPw);</div>
|
||||
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  <span class="keywordflow">if</span> (memcmp(hashedThisNonceAndPw, remoteHashedNonceAndPw,<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>)==0)</div>
|
||||
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  {</div>
|
||||
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="comment">// Pass</span></div>
|
||||
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsOut;</div>
|
||||
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)<a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3a717135e1448a14fd201931c450b7cd1a">ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_SUCCESS</a>);</div>
|
||||
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#af777083a659116082f109ccd9c8639f5" title="Align the bitstream to the byte boundary and then write the specified number of bits.">WriteAlignedBytes</a>((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) usedNonce,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#af777083a659116082f109ccd9c8639f5" title="Align the bitstream to the byte boundary and then write the specified number of bits.">WriteAlignedBytes</a>((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) remoteHashedNonceAndPw,<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>);</div>
|
||||
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>(passwordIdentifier);</div>
|
||||
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#aa9c79c0d16ece39114231d680190d39a">SendUnified</a>(&bsOut,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#a659378374e516180f93640c79f59705cacb1785f11dd02aa7f5d164fb314c594e">HIGH_PRIORITY</a>,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#ae41fa01235e99dced384d137fa874a7eaff2d39b163bcf3e142744962bfb0849f">RELIABLE_ORDERED</a>,0,packet,<span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span> </div>
|
||||
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="comment">// Incoming success, modify packet header to tell user</span></div>
|
||||
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a9bf3b18bd759234c97faf220aa47c6a5">PushToUser</a>(<a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3ac172bba552038ffc2d2558501c795bc2">ID_TWO_WAY_AUTHENTICATION_INCOMING_CHALLENGE_SUCCESS</a>, passwordIdentifier, packet);</div>
|
||||
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span> </div>
|
||||
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  <span class="keywordflow">return</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#gga5c8f613a7c294e0b96deccbdabc38f18a9f27ed7ccb7513dceb7ed4da3d99a1bf" title="The plugin used this message and it shouldn't be given to the user.">RR_STOP_PROCESSING_AND_DEALLOCATE</a>;</div>
|
||||
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  }</div>
|
||||
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  }</div>
|
||||
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span> </div>
|
||||
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="comment">// Incoming failure, modify arrived packet header to tell user</span></div>
|
||||
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>[0]=(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>) <a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3a316f94a26aafc229ef40bd2c7f9879f8">ID_TWO_WAY_AUTHENTICATION_INCOMING_CHALLENGE_FAILURE</a>;</div>
|
||||
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  </div>
|
||||
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsOut;</div>
|
||||
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>((<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)<a class="code" href="../../d6/d83/_message_identifiers_8h.xhtml#ac1b471af280629f5ace02e586d5bcfd3a3b03ba34163c20d4a3918da7baf9d99c">ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_FAILURE</a>);</div>
|
||||
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#af777083a659116082f109ccd9c8639f5" title="Align the bitstream to the byte boundary and then write the specified number of bits.">WriteAlignedBytes</a>((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) usedNonce,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#af777083a659116082f109ccd9c8639f5" title="Align the bitstream to the byte boundary and then write the specified number of bits.">WriteAlignedBytes</a>((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) remoteHashedNonceAndPw,<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>);</div>
|
||||
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  bsOut.<a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml#a2d1187ee508dc9d231d27aed1867d201" title="Write any integral type to a bitstream.">Write</a>(passwordIdentifier);</div>
|
||||
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#aa9c79c0d16ece39114231d680190d39a">SendUnified</a>(&bsOut,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#a659378374e516180f93640c79f59705cacb1785f11dd02aa7f5d164fb314c594e">HIGH_PRIORITY</a>,<a class="code" href="../../d7/d03/_packet_priority_8h.xhtml#ae41fa01235e99dced384d137fa874a7eaff2d39b163bcf3e142744962bfb0849f">RELIABLE_ORDERED</a>,0,packet,<span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span> </div>
|
||||
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  <span class="keywordflow">return</span> <a class="code" href="../../de/d14/group___p_l_u_g_i_n___i_n_t_e_r_f_a_c_e___g_r_o_u_p.xhtml#gga5c8f613a7c294e0b96deccbdabc38f18a5b5a476b87be78212057efd5535345d4" title="This message will be processed by other plugins, and at last by the user.">RR_CONTINUE_PROCESSING</a>;</div>
|
||||
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span> }</div>
|
||||
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#ac749a802cdc9829e011b756d527c0683">TwoWayAuthentication::OnPasswordResult</a>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#d8/d23/struct_s_l_net_1_1_packet" title="This represents a user message from another system.">Packet</a> *packet)</div>
|
||||
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span> {</div>
|
||||
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <a class="code" href="../../df/d75/class_s_l_net_1_1_bit_stream.xhtml">SLNet::BitStream</a> bsIn(packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>, packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a75dfd0a23cc4c14dd338caedabe19341" title="The length of the data in bytes.">length</a>, <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  bsIn.IgnoreBytes(<span class="keyword">sizeof</span>(<a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#a5b5b9eb3be9ad636af02da44b718a75f" title="First byte of a network message.">MessageID</a>)*1);</div>
|
||||
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <span class="keywordtype">char</span> usedNonce[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#aaa86357a26d52aae1bbb4337f804ff62">TWO_WAY_AUTHENTICATION_NONCE_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  bsIn.ReadAlignedBytes((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)usedNonce,TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="keywordtype">char</span> hashedNonceAndPw[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  bsIn.ReadAlignedBytes((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)hashedNonceAndPw,<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>);</div>
|
||||
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  <a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> passwordIdentifier;</div>
|
||||
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  bsIn.Read(passwordIdentifier);</div>
|
||||
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span> </div>
|
||||
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml">DataStructures::HashIndex</a> skhi = <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#af31d2ff3160e0d7e0275faf0a2e35fb7">GetIndexOf</a>(passwordIdentifier.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#ac661bded7f8850f8cf7bbcad8406d3e4" title="Same as std::string::c_str.">C_String</a>());</div>
|
||||
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <span class="keywordflow">if</span> (skhi.<a class="code" href="../../df/de0/struct_data_structures_1_1_hash_index.xhtml#a5d5347b85316db1181a65fc05a388460">IsInvalid</a>()==<span class="keyword">false</span>)</div>
|
||||
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  {</div>
|
||||
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  <a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> password = <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a4f5950a9585950680938fcf9934a4381">passwords</a>.<a class="code" href="../../d6/d83/class_data_structures_1_1_hash.xhtml#a5fec5e2f5f479ddeebefe9a0ff1c50e4">ItemAtIndex</a>(skhi);</div>
|
||||
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <span class="keywordtype">char</span> testHash[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>];</div>
|
||||
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a6b28e2a151770a5447d9dfb73250f42a">Hash</a>(usedNonce, password, testHash);</div>
|
||||
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  <span class="keywordflow">if</span> (memcmp(testHash,hashedNonceAndPw,<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>)==0)</div>
|
||||
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  {</div>
|
||||
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  <span class="comment">// Lookup the outgoing challenge and remove it from the list</span></div>
|
||||
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i;</div>
|
||||
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <a class="code" href="../../d3/da8/struct_s_l_net_1_1_address_or_g_u_i_d.xhtml">AddressOrGUID</a> aog(packet);</div>
|
||||
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  <span class="keywordflow">for</span> (i=0; i < <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#ae2aec093c82f780558c23f8ae9f296b8">Size</a>(); i++)</div>
|
||||
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  {</div>
|
||||
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="keywordflow">if</span> (<a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].identifier==passwordIdentifier &&</div>
|
||||
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].remoteSystem==aog &&</div>
|
||||
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>[i].sentHash==<span class="keyword">true</span>)</div>
|
||||
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  {</div>
|
||||
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#abd69e57bd42a42527a45da884a5318d3">outgoingChallenges</a>.<a class="code" href="../../d3/d87/class_data_structures_1_1_queue.xhtml#a8be7c3107161bb2ad869a9a6bb60605a">RemoveAtIndex</a>(i);</div>
|
||||
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span> </div>
|
||||
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a9bf3b18bd759234c97faf220aa47c6a5">PushToUser</a>(packet-><a class="code" href="../../dd/d30/namespace_s_l_net.xhtml#aff6d115daef2787d582f9a20efd64fc0" title="The data from the sender.">data</a>[0], passwordIdentifier, packet);</div>
|
||||
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  }</div>
|
||||
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  }</div>
|
||||
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  }</div>
|
||||
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  }</div>
|
||||
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span> }</div>
|
||||
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span> <span class="keywordtype">void</span> <a class="code" href="../../df/db6/group___p_l_u_g_i_n_s___g_r_o_u_p.xhtml#a6b28e2a151770a5447d9dfb73250f42a">TwoWayAuthentication::Hash</a>(<span class="keywordtype">char</span> thierNonce[TWO_WAY_AUTHENTICATION_NONCE_LENGTH], <a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml" title="String class.">SLNet::RakString</a> password, <span class="keywordtype">char</span> out[<a class="code" href="../../df/df8/_two_way_authentication_8h.xhtml#a6c49937ccc748d8e7482399a8c6d5536">HASHED_NONCE_AND_PW_LENGTH</a>])</div>
|
||||
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span> {</div>
|
||||
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span> <span class="preprocessor">#if LIBCAT_SECURITY==1</span></div>
|
||||
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span> <span class="preprocessor"></span> cat::Skein hash;</div>
|
||||
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <span class="keywordflow">if</span> (!hash.BeginKey(HASH_BITS)) <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  hash.Crunch(thierNonce, TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  hash.Crunch(password.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#ac661bded7f8850f8cf7bbcad8406d3e4" title="Same as std::string::c_str.">C_String</a>(), (int) password.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#abe4d216101d087910af4d93b594847b5" title="Returns the length of the string.">GetLength</a>());</div>
|
||||
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  hash.End();</div>
|
||||
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  hash.Generate(out, HASH_BYTES, STRENGTHENING_FACTOR);</div>
|
||||
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span> <span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span> <span class="preprocessor"></span> <a class="code" href="../../d9/d3f/class_c_s_h_a1.xhtml">CSHA1</a> sha1;</div>
|
||||
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  sha1.<a class="code" href="../../d9/d3f/class_c_s_h_a1.xhtml#a59536022ba64be584aed79c28f78d84c">Update</a>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) thierNonce, TWO_WAY_AUTHENTICATION_NONCE_LENGTH);</div>
|
||||
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  sha1.<a class="code" href="../../d9/d3f/class_c_s_h_a1.xhtml#a59536022ba64be584aed79c28f78d84c">Update</a>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) password.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#ac661bded7f8850f8cf7bbcad8406d3e4" title="Same as std::string::c_str.">C_String</a>(), (<span class="keywordtype">unsigned</span> int) password.<a class="code" href="../../d2/d66/class_s_l_net_1_1_rak_string.xhtml#abe4d216101d087910af4d93b594847b5" title="Returns the length of the string.">GetLength</a>());</div>
|
||||
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  sha1.<a class="code" href="../../d9/d3f/class_c_s_h_a1.xhtml#afbdaab3f2a2946d26a6144af3fec5fd8">Final</a>();</div>
|
||||
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  sha1.<a class="code" href="../../d9/d3f/class_c_s_h_a1.xhtml#a736d60c74d29c605c5e62b3095ab7405">GetHash</a>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) out);</div>
|
||||
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span> <span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span> <span class="preprocessor"></span>}</div>
|
||||
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span> </div>
|
||||
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span> <span class="preprocessor">#endif</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_74389ed8173ad57b461b9d623a1f3867.xhtml">Source</a></li><li class="navelem"><a class="el" href="../../dir_d1eb22c2ecfd8b50f59e9cbaf8260105.xhtml">src</a></li><li class="navelem"><a class="el" href="../../da/d67/_two_way_authentication_8cpp.xhtml">TwoWayAuthentication.cpp</a></li>
|
||||
<li class="footer">Generated on Wed Aug 14 2019 22:09:48 for SLikeNet by
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,3 @@
|
||||
<map id="ThreadPool< InputType, OutputType >" name="ThreadPool< InputType, OutputType >">
|
||||
<area shape="rect" id="node2" href="$d1/dbc/struct_thread_pool.xhtml" title="{ThreadPool\< ThreadData,\l int \>\n|# inputQueueMutex\l# outputQueueMutex\l# workingThreadCountMutex\l# runThreadsMutex\l# perThreadDataFactory\l# perThreadDataDestructor\l# inputFunctionQueue\l# inputQueue\l# outputQueue\l# threadDataInterface\land 6 more...\l|+ ThreadPool()\l+ ~ThreadPool()\l+ StartThreads()\l+ SetThreadDataInterface()\l+ StopThreads()\l+ AddInput()\l+ AddOutput()\l+ HasOutput()\l+ HasOutputFast()\l+ HasInput()\land 20 more...\l# RAK_THREAD_DECLARATION()\l}" alt="" coords="5,468,229,868"/>
|
||||
</map>
|
||||
@ -0,0 +1 @@
|
||||
5b49571a8dd17e94b3ab31e865f857d6
|
||||
157
Help/Doxygen/html/da/d67/struct_thread_pool__inherit__graph.svg
Normal file
157
Help/Doxygen/html/da/d67/struct_thread_pool__inherit__graph.svg
Normal file
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
|
||||
-->
|
||||
<!-- Title: ThreadPool< InputType, OutputType > Pages: 1 -->
|
||||
<!--zoomable 655 -->
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
|
||||
<defs>
|
||||
<circle id="rim" cx="0" cy="0" r="7"/>
|
||||
<circle id="rim2" cx="0" cy="0" r="3.5"/>
|
||||
<g id="zoomPlus">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomplus.mouseover" end="zoomplus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8M0,-4v8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="zoomMin">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomminus.mouseover" end="zoomminus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="dirArrow">
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="resetDef">
|
||||
<use xlink:href="#rim2" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="reset.mouseover" end="reset.mouseout"/>
|
||||
</use>
|
||||
</g>
|
||||
</defs>
|
||||
|
||||
<script type="text/javascript">
|
||||
var viewWidth = 180;
|
||||
var viewHeight = 655;
|
||||
var sectionId = 'dynsection-0';
|
||||
</script>
|
||||
<script xlink:href="../../svgpan.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="viewport">
|
||||
<title>ThreadPool< InputType, OutputType ></title>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node"><title>Node1</title>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-347.5 0,-646.5 168,-646.5 168,-347.5 0,-347.5"/>
|
||||
<text text-anchor="start" x="8" y="-634.5" font-family="Helvetica,sans-Serif" font-size="10.00">ThreadPool< InputType,</text>
|
||||
<text text-anchor="middle" x="84" y="-623.5" font-family="Helvetica,sans-Serif" font-size="10.00"> OutputType ></text>
|
||||
<polyline fill="none" stroke="black" points="0,-616.5 168,-616.5 "/>
|
||||
<text text-anchor="start" x="8" y="-604.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-593.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-582.5" font-family="Helvetica,sans-Serif" font-size="10.00"># workingThreadCountMutex</text>
|
||||
<text text-anchor="start" x="8" y="-571.5" font-family="Helvetica,sans-Serif" font-size="10.00"># runThreadsMutex</text>
|
||||
<text text-anchor="start" x="8" y="-560.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataFactory</text>
|
||||
<text text-anchor="start" x="8" y="-549.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataDestructor</text>
|
||||
<text text-anchor="start" x="8" y="-538.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputFunctionQueue</text>
|
||||
<text text-anchor="start" x="8" y="-527.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-516.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-505.5" font-family="Helvetica,sans-Serif" font-size="10.00"># threadDataInterface</text>
|
||||
<text text-anchor="start" x="8" y="-494.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 6 more...</text>
|
||||
<polyline fill="none" stroke="black" points="0,-487.5 168,-487.5 "/>
|
||||
<text text-anchor="start" x="8" y="-475.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-464.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ~ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-453.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StartThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-442.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ SetThreadDataInterface()</text>
|
||||
<text text-anchor="start" x="8" y="-431.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StopThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-420.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddInput()</text>
|
||||
<text text-anchor="start" x="8" y="-409.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-398.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-387.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutputFast()</text>
|
||||
<text text-anchor="start" x="8" y="-376.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasInput()</text>
|
||||
<text text-anchor="start" x="8" y="-365.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 20 more...</text>
|
||||
<text text-anchor="start" x="8" y="-354.5" font-family="Helvetica,sans-Serif" font-size="10.00"># RAK_THREAD_DECLARATION()</text>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node"><title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d1/dbc/struct_thread_pool.xhtml" target="_top" xlink:title="{ThreadPool\< ThreadData,\l int \>\n|# inputQueueMutex\l# outputQueueMutex\l# workingThreadCountMutex\l# runThreadsMutex\l# perThreadDataFactory\l# perThreadDataDestructor\l# inputFunctionQueue\l# inputQueue\l# outputQueue\l# threadDataInterface\land 6 more...\l|+ ThreadPool()\l+ ~ThreadPool()\l+ StartThreads()\l+ SetThreadDataInterface()\l+ StopThreads()\l+ AddInput()\l+ AddOutput()\l+ HasOutput()\l+ HasOutputFast()\l+ HasInput()\land 20 more...\l# RAK_THREAD_DECLARATION()\l}">
|
||||
<polygon fill="none" stroke="black" points="0,-0.5 0,-299.5 168,-299.5 168,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-287.5" font-family="Helvetica,sans-Serif" font-size="10.00">ThreadPool< ThreadData,</text>
|
||||
<text text-anchor="middle" x="84" y="-276.5" font-family="Helvetica,sans-Serif" font-size="10.00"> int ></text>
|
||||
<polyline fill="none" stroke="black" points="0,-269.5 168,-269.5 "/>
|
||||
<text text-anchor="start" x="8" y="-257.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-246.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-235.5" font-family="Helvetica,sans-Serif" font-size="10.00"># workingThreadCountMutex</text>
|
||||
<text text-anchor="start" x="8" y="-224.5" font-family="Helvetica,sans-Serif" font-size="10.00"># runThreadsMutex</text>
|
||||
<text text-anchor="start" x="8" y="-213.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataFactory</text>
|
||||
<text text-anchor="start" x="8" y="-202.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataDestructor</text>
|
||||
<text text-anchor="start" x="8" y="-191.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputFunctionQueue</text>
|
||||
<text text-anchor="start" x="8" y="-180.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-169.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-158.5" font-family="Helvetica,sans-Serif" font-size="10.00"># threadDataInterface</text>
|
||||
<text text-anchor="start" x="8" y="-147.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 6 more...</text>
|
||||
<polyline fill="none" stroke="black" points="0,-140.5 168,-140.5 "/>
|
||||
<text text-anchor="start" x="8" y="-128.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-117.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ~ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-106.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StartThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-95.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ SetThreadDataInterface()</text>
|
||||
<text text-anchor="start" x="8" y="-84.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StopThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-73.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddInput()</text>
|
||||
<text text-anchor="start" x="8" y="-62.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-51.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-40.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutputFast()</text>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasInput()</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 20 more...</text>
|
||||
<text text-anchor="start" x="8" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00"># RAK_THREAD_DECLARATION()</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge"><title>Node1->Node2</title>
|
||||
<path fill="none" stroke="orange" d="M84,-337.357C84,-324.756 84,-312.056 84,-299.528"/>
|
||||
<polygon fill="orange" stroke="orange" points="80.5001,-337.436 84,-347.436 87.5001,-337.436 80.5001,-337.436"/>
|
||||
<text text-anchor="middle" x="128" y="-321" font-family="Helvetica,sans-Serif" font-size="10.00"> < ThreadData, int ></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<g id="navigator" transform="translate(0 0)" fill="#404254">
|
||||
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
|
||||
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
|
||||
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
|
||||
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
|
||||
<g id="arrowUp" xlink:href="#dirArrow" transform="translate(30 24)" onmousedown="handlePan(0,-1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowUp.mouseover" end="arrowUp.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowRight" xlink:href="#dirArrow" transform="rotate(90) translate(36 -43)" onmousedown="handlePan(1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowRight.mouseover" end="arrowRight.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowDown" xlink:href="#dirArrow" transform="rotate(180) translate(-30 -48)" onmousedown="handlePan(0,1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowDown.mouseover" end="arrowDown.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowLeft" xlink:href="#dirArrow" transform="rotate(270) translate(-36 17)" onmousedown="handlePan(-1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowLeft.mouseover" end="arrowLeft.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
</g>
|
||||
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
|
||||
<g id="arrow_out" transform="scale(0.3 0.3)">
|
||||
<a xlink:href="struct_thread_pool__inherit__graph_org.svg" target="_base">
|
||||
<rect id="button" ry="5" rx="5" y="6" x="6" height="38" width="38"
|
||||
fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width="1.0"/>
|
||||
<path id="arrow"
|
||||
d="M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z"
|
||||
style="fill:#404040;"/>
|
||||
</a>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
|
||||
-->
|
||||
<!-- Title: ThreadPool< InputType, OutputType > Pages: 1 -->
|
||||
<svg width="180pt" height="655pt"
|
||||
viewBox="0.00 0.00 180.00 655.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 651)">
|
||||
<title>ThreadPool< InputType, OutputType ></title>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node"><title>Node1</title>
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-347.5 0,-646.5 168,-646.5 168,-347.5 0,-347.5"/>
|
||||
<text text-anchor="start" x="8" y="-634.5" font-family="Helvetica,sans-Serif" font-size="10.00">ThreadPool< InputType,</text>
|
||||
<text text-anchor="middle" x="84" y="-623.5" font-family="Helvetica,sans-Serif" font-size="10.00"> OutputType ></text>
|
||||
<polyline fill="none" stroke="black" points="0,-616.5 168,-616.5 "/>
|
||||
<text text-anchor="start" x="8" y="-604.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-593.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-582.5" font-family="Helvetica,sans-Serif" font-size="10.00"># workingThreadCountMutex</text>
|
||||
<text text-anchor="start" x="8" y="-571.5" font-family="Helvetica,sans-Serif" font-size="10.00"># runThreadsMutex</text>
|
||||
<text text-anchor="start" x="8" y="-560.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataFactory</text>
|
||||
<text text-anchor="start" x="8" y="-549.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataDestructor</text>
|
||||
<text text-anchor="start" x="8" y="-538.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputFunctionQueue</text>
|
||||
<text text-anchor="start" x="8" y="-527.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-516.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-505.5" font-family="Helvetica,sans-Serif" font-size="10.00"># threadDataInterface</text>
|
||||
<text text-anchor="start" x="8" y="-494.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 6 more...</text>
|
||||
<polyline fill="none" stroke="black" points="0,-487.5 168,-487.5 "/>
|
||||
<text text-anchor="start" x="8" y="-475.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-464.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ~ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-453.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StartThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-442.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ SetThreadDataInterface()</text>
|
||||
<text text-anchor="start" x="8" y="-431.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StopThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-420.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddInput()</text>
|
||||
<text text-anchor="start" x="8" y="-409.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-398.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-387.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutputFast()</text>
|
||||
<text text-anchor="start" x="8" y="-376.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasInput()</text>
|
||||
<text text-anchor="start" x="8" y="-365.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 20 more...</text>
|
||||
<text text-anchor="start" x="8" y="-354.5" font-family="Helvetica,sans-Serif" font-size="10.00"># RAK_THREAD_DECLARATION()</text>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node"><title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d1/dbc/struct_thread_pool.xhtml" target="_top" xlink:title="{ThreadPool\< ThreadData,\l int \>\n|# inputQueueMutex\l# outputQueueMutex\l# workingThreadCountMutex\l# runThreadsMutex\l# perThreadDataFactory\l# perThreadDataDestructor\l# inputFunctionQueue\l# inputQueue\l# outputQueue\l# threadDataInterface\land 6 more...\l|+ ThreadPool()\l+ ~ThreadPool()\l+ StartThreads()\l+ SetThreadDataInterface()\l+ StopThreads()\l+ AddInput()\l+ AddOutput()\l+ HasOutput()\l+ HasOutputFast()\l+ HasInput()\land 20 more...\l# RAK_THREAD_DECLARATION()\l}">
|
||||
<polygon fill="none" stroke="black" points="0,-0.5 0,-299.5 168,-299.5 168,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-287.5" font-family="Helvetica,sans-Serif" font-size="10.00">ThreadPool< ThreadData,</text>
|
||||
<text text-anchor="middle" x="84" y="-276.5" font-family="Helvetica,sans-Serif" font-size="10.00"> int ></text>
|
||||
<polyline fill="none" stroke="black" points="0,-269.5 168,-269.5 "/>
|
||||
<text text-anchor="start" x="8" y="-257.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-246.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueueMutex</text>
|
||||
<text text-anchor="start" x="8" y="-235.5" font-family="Helvetica,sans-Serif" font-size="10.00"># workingThreadCountMutex</text>
|
||||
<text text-anchor="start" x="8" y="-224.5" font-family="Helvetica,sans-Serif" font-size="10.00"># runThreadsMutex</text>
|
||||
<text text-anchor="start" x="8" y="-213.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataFactory</text>
|
||||
<text text-anchor="start" x="8" y="-202.5" font-family="Helvetica,sans-Serif" font-size="10.00"># perThreadDataDestructor</text>
|
||||
<text text-anchor="start" x="8" y="-191.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputFunctionQueue</text>
|
||||
<text text-anchor="start" x="8" y="-180.5" font-family="Helvetica,sans-Serif" font-size="10.00"># inputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-169.5" font-family="Helvetica,sans-Serif" font-size="10.00"># outputQueue</text>
|
||||
<text text-anchor="start" x="8" y="-158.5" font-family="Helvetica,sans-Serif" font-size="10.00"># threadDataInterface</text>
|
||||
<text text-anchor="start" x="8" y="-147.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 6 more...</text>
|
||||
<polyline fill="none" stroke="black" points="0,-140.5 168,-140.5 "/>
|
||||
<text text-anchor="start" x="8" y="-128.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-117.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ ~ThreadPool()</text>
|
||||
<text text-anchor="start" x="8" y="-106.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StartThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-95.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ SetThreadDataInterface()</text>
|
||||
<text text-anchor="start" x="8" y="-84.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ StopThreads()</text>
|
||||
<text text-anchor="start" x="8" y="-73.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddInput()</text>
|
||||
<text text-anchor="start" x="8" y="-62.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ AddOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-51.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutput()</text>
|
||||
<text text-anchor="start" x="8" y="-40.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasOutputFast()</text>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">+ HasInput()</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">and 20 more...</text>
|
||||
<text text-anchor="start" x="8" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00"># RAK_THREAD_DECLARATION()</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge"><title>Node1->Node2</title>
|
||||
<path fill="none" stroke="orange" d="M84,-337.357C84,-324.756 84,-312.056 84,-299.528"/>
|
||||
<polygon fill="orange" stroke="orange" points="80.5001,-337.436 84,-347.436 87.5001,-337.436 80.5001,-337.436"/>
|
||||
<text text-anchor="middle" x="128" y="-321" font-family="Helvetica,sans-Serif" font-size="10.00"> < ThreadData, int ></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
Reference in New Issue
Block a user