AP stuff almost works
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Melody Becker 2025-04-09 17:35:31 +02:00
parent 98191fd098
commit d272fa90b4
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
20 changed files with 574 additions and 27 deletions

View file

@ -1,8 +1,9 @@
package webdebug
import (
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"database/sql"
"encoding/json"
"fmt"
@ -64,7 +65,10 @@ func createLocalUser(w http.ResponseWriter, r *http.Request) {
return
}
publicKey, privateKey, err := ed25519.GenerateKey(nil)
// publicKey, privateKey, err := ed25519.GenerateKey(nil)
privateKey, err := rsa.GenerateKey(rand.Reader, 2048)
privateKeyBytes := x509.MarshalPKCS1PrivateKey(privateKey)
publicKeyBytes := x509.MarshalPKCS1PublicKey(&privateKey.PublicKey)
pkeyId := make([]byte, 64)
_, err = rand.Read(pkeyId)
if err != nil {
@ -96,8 +100,8 @@ func createLocalUser(w http.ResponseWriter, r *http.Request) {
Description: data.Description,
IsBot: data.IsBot,
ServerId: 1, // Hardcoded, Self is always first ID
PublicKey: publicKey,
PrivateKey: privateKey,
PublicKey: publicKeyBytes,
PrivateKey: privateKeyBytes,
PasskeyId: pkeyId,
}
if data.Birthday != nil {