diff --git a/crypto/key.go b/crypto/key.go index d844b14..d42c40e 100644 --- a/crypto/key.go +++ b/crypto/key.go @@ -456,8 +456,8 @@ func (pm *PmCrypto) GenerateRSAKeyWithPrimes( return pm.generateKey(userName, domain, passphrase, "rsa", bits, primeone, primetwo, primethree, primefour) } -// GenerateKey ... -// TODO: is it really disabled +// GenerateKey and generate primes +// TODO: is it really disabled -> no this is used by android // disabled now, will enable later // #generat new key with email address. Fix the UserID issue in protonmail system. on Feb 28, 17 // #static generate_key_with_email(email : string, passphrase : string, bits : i32) : open_pgp_key; diff --git a/crypto/keyring.go b/crypto/keyring.go index 18f75fb..38b6cb7 100644 --- a/crypto/keyring.go +++ b/crypto/keyring.go @@ -503,7 +503,7 @@ func (kr *KeyRing) readFrom(r io.Reader, armored bool) error { switch entity.PrivateKey.PrivateKey.(type) { // TODO: type mismatch after crypto lib update, fix this: case *rsa.PrivateKey: - //entity.PrimaryKey = packet.NewRSAPublicKey(time.Now(), entity.PrivateKey.PrivateKey.(*rsa.PrivateKey).Public().(*rsa.PublicKey)) + entity.PrimaryKey = packet.NewRSAPublicKey(time.Now(), entity.PrivateKey.PrivateKey.(*rsa.PrivateKey).Public().(*rsa.PublicKey)) case *ecdsa.PrivateKey: entity.PrimaryKey = packet.NewECDSAPublicKey(time.Now(), entity.PrivateKey.PrivateKey.(*ecdsa.PrivateKey).Public().(*ecdsa.PublicKey)) } @@ -512,7 +512,7 @@ func (kr *KeyRing) readFrom(r io.Reader, armored bool) error { if subkey.PrivateKey != nil { switch subkey.PrivateKey.PrivateKey.(type) { case *rsa.PrivateKey: - //subkey.PublicKey = packet.NewRSAPublicKey(time.Now(), subkey.PrivateKey.PrivateKey.(*rsa.PrivateKey).Public().(*rsa.PublicKey)) + subkey.PublicKey = packet.NewRSAPublicKey(time.Now(), subkey.PrivateKey.PrivateKey.(*rsa.PrivateKey).Public().(*rsa.PublicKey)) case *ecdsa.PrivateKey: subkey.PublicKey = packet.NewECDSAPublicKey(time.Now(), subkey.PrivateKey.PrivateKey.(*ecdsa.PrivateKey).Public().(*ecdsa.PublicKey)) }