mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
remove debug code
This commit is contained in:
parent
d222f6739a
commit
4415101436
@ -1,5 +1,3 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
|
||||
import { worker } from 'workerpool'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
@ -23,29 +21,12 @@ export const SecretKeyCryptographyCreateKey = (
|
||||
configLoginAppSecret: Buffer,
|
||||
configLoginServerKey: Buffer,
|
||||
): bigint => {
|
||||
/*
|
||||
console.log('SecretKeyCryptographyCreateKey')
|
||||
const state = Buffer.alloc(crypto_hash_sha512_STATEBYTES)
|
||||
crypto_hash_sha512_init(state)
|
||||
console.log('before salt')
|
||||
console.log('salt as buffer', Buffer.from(salt).toString('hex'))
|
||||
crypto_hash_sha512_update(state, Buffer.from(salt))
|
||||
console.log('before configLoginAppSecret')
|
||||
console.log('configLoginAppSecret', configLoginAppSecret.toString('hex'))
|
||||
crypto_hash_sha512_update(state, configLoginAppSecret)
|
||||
const hash = Buffer.alloc(crypto_hash_sha512_BYTES)
|
||||
console.log('hash buffer size', hash.length)
|
||||
console.log('before final')
|
||||
console.log(typeof crypto_hash_sha512_final)
|
||||
crypto_hash_sha512_final(state, hash)
|
||||
console.log('after final')
|
||||
console.log('hash', hash.toString('hex'))
|
||||
*/
|
||||
const state = createHash('sha512')
|
||||
state.update(Buffer.from(salt))
|
||||
state.update(configLoginAppSecret)
|
||||
const hash = state.digest()
|
||||
console.log('hash', hash.toString('hex'))
|
||||
|
||||
const encryptionKey = Buffer.alloc(crypto_box_SEEDBYTES)
|
||||
const opsLimit = 10
|
||||
|
||||
@ -58,7 +58,6 @@ export const SecretKeyCryptographyCreateKey = async (
|
||||
}
|
||||
let result: Promise<bigint>
|
||||
if (encryptionWorkerPool) {
|
||||
console.log('encrypt password with worker')
|
||||
result = (await encryptionWorkerPool.exec('SecretKeyCryptographyCreateKey', [
|
||||
salt,
|
||||
password,
|
||||
@ -66,7 +65,6 @@ export const SecretKeyCryptographyCreateKey = async (
|
||||
configLoginServerKey,
|
||||
])) as Promise<bigint>
|
||||
} else {
|
||||
console.log('encrypt password without worker')
|
||||
result = Promise.resolve(
|
||||
SecretKeyCryptographyCreateKeySync(
|
||||
salt,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user