summaryrefslogtreecommitdiff
path: root/internal/stupidgcm/without_openssl.go
blob: 91dd33ce7167f164dbcb82c9187192c2c0e3e344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// +build without_openssl

package stupidgcm

import (
	"os"

	"github.com/rfjakob/gocryptfs/internal/tlog"
)

type stupidGCM struct{}

const (
	// BuiltWithoutOpenssl indicates if openssl been disabled at compile-time
	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()
	// This panic is never reached, but having it here stops the Go compiler
	// from complaining about the missing return code.
	panic("")
}

func (g stupidGCM) NonceSize() int {
	errExit()
	panic("")
}

func (g stupidGCM) Overhead() int {
	errExit()
	panic("")
}

func (g stupidGCM) Seal(_, _, _, _ []byte) []byte {
	errExit()
	panic("")
}

func (g stupidGCM) Open(_, _, _, _ []byte) ([]byte, error) {
	errExit()
	panic("")
}