A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/cloudflare/cfssl/commit/b069c865435fd29bc93168a6832c3364b17a2147 below:

remove unused testGenerateKeypair utility · cloudflare/cfssl@b069c86 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+0

-49

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+0

-49

lines changed Original file line number Diff line number Diff line change

@@ -7,11 +7,9 @@ import (

7 7

"os"

8 8

"testing"

9 9 10 -

"github.com/cloudflare/cfssl/config"

11 10

"github.com/cloudflare/cfssl/csr"

12 11

"github.com/cloudflare/cfssl/helpers"

13 12

"github.com/cloudflare/cfssl/initca"

14 -

"github.com/cloudflare/cfssl/selfsign"

15 13

)

16 14 17 15

func tempName() (string, error) {

@@ -25,53 +23,6 @@ func tempName() (string, error) {

25 23

return name, nil

26 24

}

27 25 28 -

func testGenerateKeypair(req *csr.CertificateRequest) (keyFile, certFile string, err error) {

29 -

fail := func(err error) (string, string, error) {

30 -

if keyFile != "" {

31 -

os.Remove(keyFile)

32 -

}

33 -

if certFile != "" {

34 -

os.Remove(certFile)

35 -

}

36 -

return "", "", err

37 -

}

38 - 39 -

keyFile, err = tempName()

40 -

if err != nil {

41 -

return fail(err)

42 -

}

43 - 44 -

certFile, err = tempName()

45 -

if err != nil {

46 -

return fail(err)

47 -

}

48 - 49 -

csrPEM, keyPEM, err := csr.ParseRequest(req)

50 -

if err != nil {

51 -

return fail(err)

52 -

}

53 - 54 -

if err = ioutil.WriteFile(keyFile, keyPEM, 0644); err != nil {

55 -

return fail(err)

56 -

}

57 - 58 -

priv, err := helpers.ParsePrivateKeyPEM(keyPEM)

59 -

if err != nil {

60 -

return fail(err)

61 -

}

62 - 63 -

cert, err := selfsign.Sign(priv, csrPEM, config.DefaultConfig())

64 -

if err != nil {

65 -

return fail(err)

66 -

}

67 - 68 -

if err = ioutil.WriteFile(certFile, cert, 0644); err != nil {

69 -

return fail(err)

70 -

}

71 - 72 -

return

73 -

}

74 - 75 26

func TestEncodePEM(t *testing.T) {

76 27

p := &pem.Block{

77 28

Type: "CERTIFICATE REQUEST",

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4