bug修复
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Qumolama.d
2022-05-13 15:28:13 +08:00
parent c94563f5c8
commit c8891848f1
4 changed files with 28 additions and 19 deletions

View File

@ -49,7 +49,7 @@ export const setup = async () => {
config.custom.postRouting(server)
/*
if(process.env["UNIT_TEST"] || process.env["DEVEL_FIRST_RUN"]) {
// Create a test player
await new models.Player({
username: 'test',
@ -63,7 +63,7 @@ export const setup = async () => {
registerDate: Date.now(),
permissions: [{ node: 'login', allowed: true, duration: 0, eternal: true, startDate: Date.now(), highPriority: false }]
}).save()
*/
}
}
const launch = async () => {

View File

@ -2,6 +2,7 @@ import { PNG } from 'pngjs'
import fs from 'fs'
import { createHash, createPrivateKey, createSign } from 'crypto'
import { config } from './config.js'
import { server } from './index.js'
export const ImageSecurity = {
createImageHash: async (path, isCape) => {
@ -70,7 +71,7 @@ export const ImageSecurity = {
throw new Error('Invalid image size')
},
sign: async (data) => {
return createSign('RSA-SHA1').update(data).sign(createPrivateKey(config.privateKey), 'hex')
return createSign('RSA-SHA1').update(data).sign({ key: createPrivateKey(server.keys.privateKey) }, 'hex')
}
}