change genSignKeypair to genNaclSignKeypair or stuff
This commit is contained in:
parent
fea75f7200
commit
e78286cc06
@ -297,7 +297,7 @@ func handleKeyPost(self *dialogNode, form url.Values, conf *configparser.Configu
|
|||||||
|
|
||||||
func prepareKeyModel(self *dialogNode, err error, conf *configparser.Configuration) templateModel {
|
func prepareKeyModel(self *dialogNode, err error, conf *configparser.Configuration) templateModel {
|
||||||
param := make(map[string]interface{})
|
param := make(map[string]interface{})
|
||||||
public, secret := newSignKeypair()
|
public, secret := newNaclSignKeypair()
|
||||||
param["dialog"] = &KeyModel{ErrorModel{err}, StepModel{self}, public, secret}
|
param["dialog"] = &KeyModel{ErrorModel{err}, StepModel{self}, public, secret}
|
||||||
return param
|
return param
|
||||||
}
|
}
|
||||||
|
@ -701,7 +701,7 @@ func (self httpModUI) HandleLogin(wr http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self httpModUI) HandleKeyGen(wr http.ResponseWriter, r *http.Request) {
|
func (self httpModUI) HandleKeyGen(wr http.ResponseWriter, r *http.Request) {
|
||||||
pk, sk := newSignKeypair()
|
pk, sk := newNaclSignKeypair()
|
||||||
tripcode := makeTripcode(pk)
|
tripcode := makeTripcode(pk)
|
||||||
self.writeTemplateParam(wr, r, "keygen.mustache", map[string]interface{}{"public": pk, "secret": sk, "tripcode": tripcode})
|
self.writeTemplateParam(wr, r, "keygen.mustache", map[string]interface{}{"public": pk, "secret": sk, "tripcode": tripcode})
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ func reThumbnail(threads int, store ArticleStore, missing bool) {
|
|||||||
|
|
||||||
// generate a keypair from the command line
|
// generate a keypair from the command line
|
||||||
func KeygenTool() {
|
func KeygenTool() {
|
||||||
pub, sec := newSignKeypair()
|
pub, sec := newNaclSignKeypair()
|
||||||
log.Println("public key:", pub)
|
log.Println("public key:", pub)
|
||||||
log.Println("secret key:", sec)
|
log.Println("secret key:", sec)
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ func ValidNewsgroup(newsgroup string) bool {
|
|||||||
return newsgroupValidFormat(newsgroup)
|
return newsgroupValidFormat(newsgroup)
|
||||||
}
|
}
|
||||||
|
|
||||||
func genKeypair() (pk, sk []byte) {
|
func genNaclKeypair() (pk, sk []byte) {
|
||||||
sk = randbytes(32)
|
sk = randbytes(32)
|
||||||
pk, _ = naclSeedToKeyPair(sk)
|
pk, _ = naclSeedToKeyPair(sk)
|
||||||
return
|
return
|
||||||
@ -304,8 +304,8 @@ func genKeypair() (pk, sk []byte) {
|
|||||||
|
|
||||||
// generate a new signing keypair
|
// generate a new signing keypair
|
||||||
// public, secret
|
// public, secret
|
||||||
func newSignKeypair() (string, string) {
|
func newNaclSignKeypair() (string, string) {
|
||||||
pk, sk := genKeypair()
|
pk, sk := genNaclKeypair()
|
||||||
return hex.EncodeToString(pk), hex.EncodeToString(sk)
|
return hex.EncodeToString(pk), hex.EncodeToString(sk)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user