Fix generateRSAKey method

This commit is contained in:
Melroy van den Berg 2025-04-24 17:03:01 +02:00
parent 59ab3190b9
commit d5e03e8a1f
No known key found for this signature in database
GPG key ID: 71D11FF23454B9D7

View file

@ -1,6 +1,7 @@
package resolver
import (
"crypto/rand"
"crypto/rsa"
"encoding/json"
"fmt"
@ -415,7 +416,7 @@ func (r *Resolver) extractPublicKey(actorData map[string]interface{}) (string, s
func generateRSAKey() (*rsa.PrivateKey, error) {
// In a real app, we would use a persistent key, but for this demo, we'll generate a new one
// For server-to-server communication, this is not ideal but works for demonstration purposes
return rsa.GenerateKey(strings.NewReader("fediresolve-demo-random-source"), 2048)
return rsa.GenerateKey(rand.Reader, 2048)
}
// signRequest signs an HTTP request using HTTP Signatures