Minor build fixes

This commit is contained in:
Jakub Lehotsky 2018-11-01 17:03:43 +01:00
parent b3e6e67cac
commit 0bf075d49d
19 changed files with 40 additions and 39 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
.DS_Store
bin
dist
vendor
.vscode
.vscode

View file

@ -3,8 +3,8 @@ package armor
import (
"bytes"
"errors"
"gitlab.com/ProtonMail/go-pm-crypto/internal"
"gitlab.com/ProtonMail/go-pm-crypto/models"
"github.com/ProtonMail/go-pm-crypto/internal"
"github.com/ProtonMail/go-pm-crypto/models"
"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/clearsign"
"golang.org/x/crypto/openpgp/packet"

View file

@ -1,7 +1,7 @@
package armor
import (
"gitlab.com/ProtonMail/go-pm-crypto/internal"
"github.com/ProtonMail/go-pm-crypto/internal"
)
const (

View file

@ -10,12 +10,13 @@ mkdir -p $IOS_OUT
# CHECK="${1-0}"
# if [ ${CHECK} -eq "1" ]; then
printf "\e[0;32mStart Building iOS framework .. Location: ${IOS_OUT} \033[0m\n\n"
PACKAGE_PATH=github.com/ProtonMail/go-pm-crypto
gomobile bind -target ios -o ${IOS_OUT}/pmcrypto.framework proton/pmcrypto/crypto proton/pmcrypto/armor proton/pmcrypto/constants proton/pmcrypto/key proton/pmcrypto/models
gomobile bind -target ios -o ${IOS_OUT}/pmcrypto.framework $PACKAGE_PATH/crypto $PACKAGE_PATH/armor $PACKAGE_PATH/constants $PACKAGE_PATH/key $PACKAGE_PATH/models
printf "\e[0;32mStart Building Android lib .. Location: ${ANDROID_OUT} \033[0m\n\n"
gomobile bind -target android -javapkg com.proton.pmcrypto -o ${ANDROID_OUT}/pmcrypto.aar proton/pmcrypto/crypto proton/pmcrypto/armor proton/pmcrypto/constants proton/pmcrypto/key proton/pmcrypto/models
gomobile bind -target android -javapkg com.proton.pmcrypto -o ${ANDROID_OUT}/pmcrypto.aar $PACKAGE_PATH/crypto $PACKAGE_PATH/armor $PACKAGE_PATH/constants $PACKAGE_PATH/key $PACKAGE_PATH/models
printf "\e[0;32mInstalling frameworks. \033[0m\n\n"

View file

@ -5,9 +5,9 @@ import (
"io"
"io/ioutil"
armorUtils "gitlab.com/ProtonMail/go-pm-crypto/armor"
"gitlab.com/ProtonMail/go-pm-crypto/internal"
"gitlab.com/ProtonMail/go-pm-crypto/models"
armorUtils "github.com/ProtonMail/go-pm-crypto/armor"
"github.com/ProtonMail/go-pm-crypto/internal"
"github.com/ProtonMail/go-pm-crypto/models"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/packet"

View file

@ -8,7 +8,7 @@ import (
"strings"
"time"
"gitlab.com/ProtonMail/go-pm-crypto/armor"
"github.com/ProtonMail/go-pm-crypto/armor"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
"math/big"

View file

@ -8,9 +8,9 @@ import (
"strings"
"time"
armorUtils "gitlab.com/ProtonMail/go-pm-crypto/armor"
"gitlab.com/ProtonMail/go-pm-crypto/internal"
"gitlab.com/ProtonMail/go-pm-crypto/models"
armorUtils "github.com/ProtonMail/go-pm-crypto/armor"
"github.com/ProtonMail/go-pm-crypto/internal"
"github.com/ProtonMail/go-pm-crypto/models"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
errors2 "golang.org/x/crypto/openpgp/errors"

View file

@ -2,8 +2,8 @@ package crypto
import (
"bytes"
"github.com/ProtonMail/go-pm-crypto/armor"
"github.com/ProtonMail/go-pm-mime"
"gitlab.com/ProtonMail/go-pm-crypto/armor"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
"io/ioutil"

View file

@ -7,8 +7,8 @@ import (
"io"
"strings"
"gitlab.com/ProtonMail/go-pm-crypto/armor"
"gitlab.com/ProtonMail/go-pm-crypto/models"
"github.com/ProtonMail/go-pm-crypto/armor"
"github.com/ProtonMail/go-pm-crypto/models"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
)

View file

@ -6,7 +6,7 @@ import (
"strings"
"time"
"gitlab.com/ProtonMail/go-pm-crypto/internal"
"github.com/ProtonMail/go-pm-crypto/internal"
"golang.org/x/crypto/openpgp"
errors2 "golang.org/x/crypto/openpgp/errors"
"golang.org/x/crypto/openpgp/packet"

Binary file not shown.

Binary file not shown.

6
glide.lock generated
View file

@ -31,7 +31,6 @@ imports:
- rsa
- ssh/terminal
- name: golang.org/x/sys
version: 8cf3aee429924738c56c34bb819c4ea8273fc434
subpackages:
- unix
- windows
@ -43,7 +42,8 @@ imports:
- encoding/internal
- encoding/internal/identifier
- transform
- name: proton/pmmime
- name: github.com/ProtonMail/go-pm-mime
version: 347d69204aa62d6958bcb3b9bbacccb24a36372b
repo: git@gitlab.protontech.ch:ProtonMail/go-pm-mime.git
repo: https://gitlab.protontech.ch/ProtonMail/go-pm-mime.git
version: feat/mimevisitor
testImports: []

View file

@ -1,7 +1,9 @@
package: proton/pmcrypto
import:
- package: golang.org/x/crypto
version: v1.0.0
version: master
repo: https://github.com/ProtonMail/crypto.git
- package: proton/pmmime
repo: git@gitlab.protontech.ch:ProtonMail/go-pm-mime.git
version: 9e4251120d8c43f10024d798bc6dde21d40704a0
- package: github.com/ProtonMail/go-pm-mime
repo: https://gitlab.protontech.ch/ProtonMail/go-pm-mime.git

View file

@ -1,7 +1,7 @@
package internal
import (
"gitlab.com/ProtonMail/go-pm-crypto/constants"
"github.com/ProtonMail/go-pm-crypto/constants"
"regexp"
)

View file

@ -5,8 +5,8 @@ import (
"encoding/hex"
"errors"
"github.com/ProtonMail/go-pm-crypto/armor"
"golang.org/x/crypto/openpgp"
"proton/pmcrypto/armor"
)
// GetFingerprint get a armored public key fingerprint

View file

@ -1,12 +1,12 @@
package key
import (
"strings"
"golang.org/x/crypto/openpgp"
"fmt"
"golang.org/x/crypto/openpgp/packet"
"bytes"
"proton/pmcrypto/armor"
"fmt"
"github.com/ProtonMail/go-pm-crypto/armor"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
"strings"
)
//CheckPassphrase check is private key passphrase ok
@ -39,7 +39,6 @@ func CheckPassphrase(privateKey string, passphrase string) bool {
return true
}
// PublicKey get a public key from a private key
func PublicKey(privateKey string) (string, error) {
privKeyReader := strings.NewReader(privateKey)

View file

@ -11,7 +11,7 @@ import (
// "net/url"
"strings"
//"gitlab.com/ProtonMail/go-pm-crypto/armor"
//"github.com/ProtonMail/go-pm-crypto/armor"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
)

View file

@ -12,16 +12,14 @@ import (
"time"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
//"golang.org/x/crypto/openpgp/armor"
pgperrors "golang.org/x/crypto/openpgp/errors"
"golang.org/x/crypto/openpgp/packet"
"gitlab.com/ProtonMail/go-pm-crypto/crypto"
armorUtils "github.com/ProtonMail/go-pm-crypto/armor"
"github.com/ProtonMail/go-pm-crypto/crypto"
)
// Armored type for PGP encrypted messages.
const pgpMessageType = "PGP MESSAGE"
// A keypair contains a private key and a public key.
type pmKeyObject struct {
ID string
@ -188,7 +186,7 @@ func (w *armorEncryptWriter) Close() (err error) {
// EncryptArmored encrypts and armors data to the keyring's owner.
func (kr *KeyRing) EncryptArmored(w io.Writer, sign *KeyRing) (wc io.WriteCloser, err error) {
aw, err := armor.Encode(w, pgpMessageType, nil)
aw, err := armorUtils.ArmorWithTypeBuffered(w, armorUtils.MESSAGE_HEADER)
if err != nil {
return
}
@ -367,7 +365,7 @@ func (kr *KeyRing) DecryptArmored(r io.Reader) (decrypted io.Reader, signed *Sig
return
}
if block.Type != pgpMessageType {
if block.Type != armorUtils.MESSAGE_HEADER {
err = errors.New("pmapi: not an armored PGP message")
return
}