imports: change the crypto lib to new import path

This commit is contained in:
proletarius101 2020-12-30 01:47:20 +08:00 committed by Simon Ser
parent 5e211c61ac
commit 0df2e43d8d
18 changed files with 36 additions and 32 deletions

View File

@ -9,9 +9,9 @@ import (
"io" "io"
"os" "os"
"golang.org/x/crypto/bcrypt" "github.com/ProtonMail/go-crypto/bcrypt"
"golang.org/x/crypto/nacl/secretbox" "github.com/ProtonMail/go-crypto/nacl/secretbox"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"github.com/emersion/hydroxide/config" "github.com/emersion/hydroxide/config"
"github.com/emersion/hydroxide/protonmail" "github.com/emersion/hydroxide/protonmail"

View File

@ -12,10 +12,10 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/emersion/go-vcard" "github.com/emersion/go-vcard"
"github.com/emersion/go-webdav/carddav" "github.com/emersion/go-webdav/carddav"
"github.com/emersion/hydroxide/protonmail" "github.com/emersion/hydroxide/protonmail"
"golang.org/x/crypto/openpgp"
) )
// TODO: use a HTTP error // TODO: use a HTTP error

View File

@ -11,14 +11,14 @@ import (
"net/http" "net/http"
"os" "os"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/ProtonMail/go-crypto/openpgp/armor"
imapmove "github.com/emersion/go-imap-move" imapmove "github.com/emersion/go-imap-move"
imapspacialuse "github.com/emersion/go-imap-specialuse" imapspacialuse "github.com/emersion/go-imap-specialuse"
imapserver "github.com/emersion/go-imap/server" imapserver "github.com/emersion/go-imap/server"
"github.com/emersion/go-mbox" "github.com/emersion/go-mbox"
"github.com/emersion/go-smtp" "github.com/emersion/go-smtp"
"github.com/howeyc/gopass" "github.com/howeyc/gopass"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"github.com/emersion/hydroxide/auth" "github.com/emersion/hydroxide/auth"
"github.com/emersion/hydroxide/carddav" "github.com/emersion/hydroxide/carddav"

View File

@ -6,11 +6,11 @@ import (
"io" "io"
"strings" "strings"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/emersion/go-mbox" "github.com/emersion/go-mbox"
"github.com/emersion/go-message" "github.com/emersion/go-message"
"github.com/emersion/go-message/mail" "github.com/emersion/go-message/mail"
"github.com/emersion/go-message/textproto" "github.com/emersion/go-message/textproto"
"golang.org/x/crypto/openpgp"
"github.com/emersion/hydroxide/protonmail" "github.com/emersion/hydroxide/protonmail"
) )

4
go.mod
View File

@ -3,6 +3,7 @@ module github.com/emersion/hydroxide
go 1.13 go 1.13
require ( require (
github.com/ProtonMail/go-crypto v0.0.0-20201208181130-20fe99622a86
github.com/boltdb/bolt v1.3.1 github.com/boltdb/bolt v1.3.1
github.com/emersion/go-bcrypt v0.0.0-20170822072041-6e724a1baa63 github.com/emersion/go-bcrypt v0.0.0-20170822072041-6e724a1baa63
github.com/emersion/go-imap v1.0.6 github.com/emersion/go-imap v1.0.6
@ -16,9 +17,6 @@ require (
github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c
github.com/kr/pretty v0.1.0 // indirect github.com/kr/pretty v0.1.0 // indirect
github.com/stretchr/testify v1.4.0 // indirect github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20201217014255-9d1352758620
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e // indirect golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
) )
replace golang.org/x/crypto => github.com/ProtonMail/crypto v0.0.0-20200605105621-11f6ee2dd602

6
go.sum
View File

@ -1,5 +1,7 @@
github.com/ProtonMail/crypto v0.0.0-20200605105621-11f6ee2dd602 h1:ainph8zAAGO7yqxvgyiZhV/kzDL/l5bXmhePsEuhKSA= github.com/ProtonMail/crypto v0.0.0-20200605105621-11f6ee2dd602 h1:ainph8zAAGO7yqxvgyiZhV/kzDL/l5bXmhePsEuhKSA=
github.com/ProtonMail/crypto v0.0.0-20200605105621-11f6ee2dd602/go.mod h1:Pxr7w4gA2ikI4sWyYwEffm+oew1WAJHzG1SiDpQMkrI= github.com/ProtonMail/crypto v0.0.0-20200605105621-11f6ee2dd602/go.mod h1:Pxr7w4gA2ikI4sWyYwEffm+oew1WAJHzG1SiDpQMkrI=
github.com/ProtonMail/go-crypto v0.0.0-20201208181130-20fe99622a86 h1:DzNYdO1Lr0wwznz5wyCGg17N0L+y4Y4QeC/r4nJZbKY=
github.com/ProtonMail/go-crypto v0.0.0-20201208181130-20fe99622a86/go.mod h1:HTM9X7e9oLwn7RiqLG0UVwVRJenLs3wN+tQ0NPAfwMQ=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
@ -56,10 +58,14 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs=
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=

View File

@ -10,10 +10,10 @@ import (
"log" "log"
"strings" "strings"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/emersion/go-imap" "github.com/emersion/go-imap"
"github.com/emersion/go-message" "github.com/emersion/go-message"
"github.com/emersion/go-message/mail" "github.com/emersion/go-message/mail"
"golang.org/x/crypto/openpgp"
"github.com/emersion/hydroxide/protonmail" "github.com/emersion/hydroxide/protonmail"
) )

View File

@ -5,10 +5,10 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/emersion/go-imap" "github.com/emersion/go-imap"
"github.com/emersion/go-imap-specialuse" "github.com/emersion/go-imap-specialuse"
imapbackend "github.com/emersion/go-imap/backend" imapbackend "github.com/emersion/go-imap/backend"
"golang.org/x/crypto/openpgp"
"github.com/emersion/hydroxide/events" "github.com/emersion/hydroxide/events"
"github.com/emersion/hydroxide/imap/database" "github.com/emersion/hydroxide/imap/database"

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"io" "io"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/ProtonMail/go-crypto/openpgp/armor"
"github.com/emersion/go-message/mail" "github.com/emersion/go-message/mail"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"github.com/emersion/hydroxide/protonmail" "github.com/emersion/hydroxide/protonmail"
) )

View File

@ -11,8 +11,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"golang.org/x/crypto/openpgp/packet" "github.com/ProtonMail/go-crypto/openpgp/packet"
) )
type AttachmentKey struct { type AttachmentKey struct {

View File

@ -7,8 +7,8 @@ import (
"net/http" "net/http"
"time" "time"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"golang.org/x/crypto/openpgp/packet" "github.com/ProtonMail/go-crypto/openpgp/packet"
) )
type authInfoReq struct { type authInfoReq struct {

View File

@ -8,9 +8,9 @@ import (
"strconv" "strconv"
"strings" "strings"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"golang.org/x/crypto/openpgp/armor" "github.com/ProtonMail/go-crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/packet" "github.com/ProtonMail/go-crypto/openpgp/packet"
) )
type Contact struct { type Contact struct {

View File

@ -6,8 +6,8 @@ import (
"io" "io"
"time" "time"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"golang.org/x/crypto/openpgp/packet" "github.com/ProtonMail/go-crypto/openpgp/packet"
) )
// primaryIdentity returns the Identity marked as primary or the first identity // primaryIdentity returns the Identity marked as primary or the first identity

View File

@ -7,7 +7,7 @@ import (
"net/url" "net/url"
"strings" "strings"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
) )
type PrivateKeyFlags int type PrivateKeyFlags int

View File

@ -10,9 +10,9 @@ import (
"strconv" "strconv"
"strings" "strings"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"golang.org/x/crypto/openpgp/armor" "github.com/ProtonMail/go-crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/packet" "github.com/ProtonMail/go-crypto/openpgp/packet"
) )
type MessageType int type MessageType int

View File

@ -11,7 +11,7 @@ import (
"strconv" "strconv"
"time" "time"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"log" "log"
) )

View File

@ -10,8 +10,8 @@ import (
"io" "io"
"math/big" "math/big"
"golang.org/x/crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp"
"golang.org/x/crypto/openpgp/clearsign" "github.com/ProtonMail/go-crypto/openpgp/clearsign"
) )
var randReader io.Reader = rand.Reader var randReader io.Reader = rand.Reader

View File

@ -8,10 +8,10 @@ import (
"log" "log"
"strings" "strings"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/ProtonMail/go-crypto/openpgp/packet"
"github.com/emersion/go-message/mail" "github.com/emersion/go-message/mail"
"github.com/emersion/go-smtp" "github.com/emersion/go-smtp"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
"github.com/emersion/hydroxide/auth" "github.com/emersion/hydroxide/auth"
"github.com/emersion/hydroxide/protonmail" "github.com/emersion/hydroxide/protonmail"