stupidgcm: fix without_openssl build
$ ./build-without-openssl.bash internal/speed/speed.go:152:14: undefined: stupidgcm.NewXchacha20poly1305
This commit is contained in:
parent
c9728247ed
commit
8f820c429d
|
@ -1,3 +1,5 @@
|
||||||
|
// +build !without_openssl
|
||||||
|
|
||||||
package stupidgcm
|
package stupidgcm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -6,6 +6,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"crypto/cipher"
|
||||||
|
|
||||||
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
|
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -21,32 +23,12 @@ func errExit() {
|
||||||
os.Exit(exitcodes.OpenSSL)
|
os.Exit(exitcodes.OpenSSL)
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(_ []byte, _ bool) *StupidGCM {
|
func New(_ []byte, _ bool) cipher.AEAD {
|
||||||
errExit()
|
|
||||||
// Never reached
|
|
||||||
return &StupidGCM{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *StupidGCM) NonceSize() int {
|
|
||||||
errExit()
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *StupidGCM) Overhead() int {
|
|
||||||
errExit()
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *StupidGCM) Seal(_, _, _, _ []byte) []byte {
|
|
||||||
errExit()
|
errExit()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *StupidGCM) Open(_, _, _, _ []byte) ([]byte, error) {
|
func NewXchacha20poly1305(_ []byte) cipher.AEAD {
|
||||||
errExit()
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *StupidGCM) Wipe() {
|
|
||||||
errExit()
|
errExit()
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build !without_openssl
|
||||||
|
|
||||||
// Copyright 2018 The Go Authors. All rights reserved.
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
Loading…
Reference in New Issue