diff --git a/src/client/encrypt.js b/src/client/encrypt.js index b9d21bab..63cc2bd9 100644 --- a/src/client/encrypt.js +++ b/src/client/encrypt.js @@ -79,7 +79,7 @@ module.exports = function (client, options) { function mcPubKeyToPem (mcPubKeyBuffer) { let pem = '-----BEGIN PUBLIC KEY-----\n' let base64PubKey = mcPubKeyBuffer.toString('base64') - const maxLineLength = 65 + const maxLineLength = 64 while (base64PubKey.length > 0) { pem += base64PubKey.substring(0, maxLineLength) + '\n' base64PubKey = base64PubKey.substring(maxLineLength) diff --git a/src/server/login.js b/src/server/login.js index 68dc27a8..599dd7f9 100644 --- a/src/server/login.js +++ b/src/server/login.js @@ -223,7 +223,7 @@ module.exports = function (client, server, options) { function mcPubKeyToPem (mcPubKeyBuffer) { let pem = '-----BEGIN RSA PUBLIC KEY-----\n' let base64PubKey = mcPubKeyBuffer.toString('base64') - const maxLineLength = 76 + const maxLineLength = 64 while (base64PubKey.length > 0) { pem += base64PubKey.substring(0, maxLineLength) + '\n' base64PubKey = base64PubKey.substring(maxLineLength)