Please help me solve a bug with my licencing system!

agolangf · · 853 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello all,</p> <p>I am creating a simple licencing system to help licence my own programs and also to help others via github. I have come across a bug that I don&#39;t really understand and am asking for some advice.</p> <p>I will add the client code soon. I also hope to add more advanced features.</p> <p>Basically,</p> <ol> <li>I have a server that listens on a port and hosts a login and register handler.</li> <li>The client will send the username and password (localhost:8080/login/username-password) to the login handler.</li> <li>The server will hash the password and check it against a local file with all the hashes stored locally on my computer.</li> <li>The server will report back if it succeeded or failed.</li> </ol> <p>When I enter the username and password, it seems as though it doesn&#39;t check the password. I can put any password and it will say success as long as I have the username right.</p> <p>I appreciate all suggestions, even if they don&#39;t fix the bug.</p> <p>Thanks!</p> <p>Code: <a href="https://gist.github.com/seriousnerve/1830e77d3e2891b0a5b158c9fb02b37f" rel="nofollow">https://gist.github.com/seriousnerve/1830e77d3e2891b0a5b158c9fb02b37f</a> </p> <hr/>**评论:**<br/><br/>justinisrael: <pre><p>You aren&#39;t checking any of your errors anywhere. If something goes wrong building your hash and you end up with HashDecoded being an empty string, then it will always return true when asking if it&#39;s contained</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

853 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传