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

@ -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')
}
}