Archived
1
0

change genSignKeypair to genNaclSignKeypair or stuff

This commit is contained in:
Jeff Becker 2017-08-25 10:56:17 -04:00
parent fea75f7200
commit e78286cc06
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
4 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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