summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-13 15:32:15 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-13 15:32:15 +0200
commit3733ee2c0ee84c054bb98d714dad49d0384208a0 (patch)
tree46200ef6a472825f35a4173735954a3d1de8bf17 /src
parentAdded Yggdrasil Authentication System (diff)
downloadcuberite-3733ee2c0ee84c054bb98d714dad49d0384208a0.tar
cuberite-3733ee2c0ee84c054bb98d714dad49d0384208a0.tar.gz
cuberite-3733ee2c0ee84c054bb98d714dad49d0384208a0.tar.bz2
cuberite-3733ee2c0ee84c054bb98d714dad49d0384208a0.tar.lz
cuberite-3733ee2c0ee84c054bb98d714dad49d0384208a0.tar.xz
cuberite-3733ee2c0ee84c054bb98d714dad49d0384208a0.tar.zst
cuberite-3733ee2c0ee84c054bb98d714dad49d0384208a0.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Authenticator.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Protocol/Authenticator.cpp b/src/Protocol/Authenticator.cpp
index ba435e9ce..24695b726 100644
--- a/src/Protocol/Authenticator.cpp
+++ b/src/Protocol/Authenticator.cpp
@@ -26,7 +26,6 @@
#define DEFAULT_AUTH_SERVER "sessionserver.mojang.com"
#define DEFAULT_AUTH_ADDRESS "/session/minecraft/hasJoined?username=%USERNAME%&serverId=%SERVERID%"
-#define MAX_REDIRECTS 10
@@ -146,8 +145,9 @@ void cAuthenticator::Execute(void)
bool cAuthenticator::AuthWithYggdrasil(AString & a_UserName, const AString & a_ServerId, AString & a_UUID)
{
AString REQUEST;
- int ret, len, server_fd = -1;
- unsigned char buf[1024];
+ int ret, server_fd = -1;
+ size_t len = -1;
+ unsigned char * buf;
const char *pers = "cAuthenticator";
entropy_context entropy;
@@ -221,7 +221,8 @@ bool cAuthenticator::AuthWithYggdrasil(AString & a_UserName, const AString & a_S
REQUEST += "Connection: close\r\n";
REQUEST += "\r\n";
- len = sprintf_s((char *)buf, sizeof(buf), REQUEST.c_str());
+ len = REQUEST.size();
+ buf = (unsigned char *)REQUEST.c_str();
while ((ret = ssl_write(&ssl, buf, len)) <= 0)
{