Browse Source

Update update-server tools

pull/2641/head
tux3 10 years ago
parent
commit
a16bdeb27c
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
  1. 6
      tools/update-server/qtox-updater-genkeys/main.cpp
  2. 1
      tools/update-server/qtox-updater-sign/main.cpp

6
tools/update-server/qtox-updater-genkeys/main.cpp

@ -9,7 +9,7 @@ int main(int argc, char *argv[])
QCoreApplication a(argc, argv); QCoreApplication a(argc, argv);
(void) a; (void) a;
QByteArray skey(crypto_box_SECRETKEYBYTES, 0); QByteArray skey(crypto_sign_SECRETKEYBYTES, 0);
QFile skeyFile("qtox-updater-skey"); QFile skeyFile("qtox-updater-skey");
if (!skeyFile.open(QIODevice::WriteOnly)) if (!skeyFile.open(QIODevice::WriteOnly))
{ {
@ -17,7 +17,7 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
QByteArray pkey(crypto_box_PUBLICKEYBYTES, 0); QByteArray pkey(crypto_sign_PUBLICKEYBYTES, 0);
QFile pkeyFile("qtox-updater-pkey"); QFile pkeyFile("qtox-updater-pkey");
if (!pkeyFile.open(QIODevice::WriteOnly)) if (!pkeyFile.open(QIODevice::WriteOnly))
{ {
@ -25,7 +25,7 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
crypto_box_keypair((uint8_t*)pkey.data(), (uint8_t*)skey.data()); crypto_sign_keypair((uint8_t*)pkey.data(), (uint8_t*)skey.data());
skeyFile.write(skey); skeyFile.write(skey);
pkeyFile.write(pkey); pkeyFile.write(pkey);

1
tools/update-server/qtox-updater-sign/main.cpp

@ -28,7 +28,6 @@ int main(int argc, char* argv[])
return 1; return 1;
} }
QByteArray skeyData = skeyFile.readAll(); QByteArray skeyData = skeyFile.readAll();
skeyData = QByteArray::fromHex(skeyData);
skeyFile.close(); skeyFile.close();
unsigned char sig[crypto_sign_BYTES]; unsigned char sig[crypto_sign_BYTES];

Loading…
Cancel
Save