2016-10-04 09:51:14 +02:00
|
|
|
// +build without_openssl
|
|
|
|
|
|
|
|
package stupidgcm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/rfjakob/gocryptfs/internal/tlog"
|
|
|
|
)
|
|
|
|
|
|
|
|
type stupidGCM struct{}
|
|
|
|
|
|
|
|
const (
|
2016-10-04 23:30:05 +02:00
|
|
|
// BuiltWithoutOpenssl indicates if openssl been disabled at compile-time
|
2016-10-04 09:51:14 +02:00
|
|
|
BuiltWithoutOpenssl = true
|
|
|
|
)
|
|
|
|
|
|
|
|
func errExit() {
|
|
|
|
tlog.Fatal.Println("gocryptfs has been compiled without openssl support but you are still trying to use openssl")
|
|
|
|
os.Exit(2)
|
|
|
|
}
|
|
|
|
|
|
|
|
func New(_ []byte) stupidGCM {
|
|
|
|
errExit()
|
2016-12-10 13:14:20 +01:00
|
|
|
// Never reached
|
|
|
|
return stupidGCM{}
|
2016-10-04 09:51:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (g stupidGCM) NonceSize() int {
|
|
|
|
errExit()
|
2016-12-10 13:14:20 +01:00
|
|
|
return -1
|
2016-10-04 09:51:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (g stupidGCM) Overhead() int {
|
|
|
|
errExit()
|
2016-12-10 13:14:20 +01:00
|
|
|
return -1
|
2016-10-04 09:51:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (g stupidGCM) Seal(_, _, _, _ []byte) []byte {
|
|
|
|
errExit()
|
2016-12-10 13:14:20 +01:00
|
|
|
return nil
|
2016-10-04 09:51:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (g stupidGCM) Open(_, _, _, _ []byte) ([]byte, error) {
|
|
|
|
errExit()
|
2016-12-10 13:14:20 +01:00
|
|
|
return nil, nil
|
2016-10-04 09:51:14 +02:00
|
|
|
}
|