summarylogtreecommitdiffstats
path: root/openssl-gost-engine.install
blob: d4c8f1f8d0205c714b7c9d06c1952b9ee1cbcfb2 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
_helpline(){
echo "

Attention! Внимание!
----

    You have to insert that line into your /etc/ssl/openssl.cnf
    before any [section]

# ---
# Set GOST Configuration
openssl_conf=openssl_gost
# ---

    And the content of gost.cnf at the very end of the openssl.cnf.
    Do not .include it.

How to check:
____

listings:
  openssl dgst -list|grep gost
  openssl engine gost -c
  openssl ciphers|tr ':' '\n'|grep GOST

hashsum: openssl dgst -engine gost -md_gost12_256 testfile
keygen:  openssl genpkey -algorithm gost2012_256 -pkeyopt paramset:TCB -out ca.key

TroubleShout
____

а) export OPENSSLDIR=/etc/ssl
б) s/openssl_gost/openssl_def/g
в) https://www.altlinux.org/%D0%93%D0%9E%D0%A1%D0%A2_%D0%B2_OpenSSL
   http://wiki.rosalab.ru/ru/index.php/OpenSSL_%D0%B8_%D0%93%D0%9E%D0%A1%D0%A2

"

}

## arg 1:  the new package version
#pre_install() {
  # do something here
#}

## arg 1:  the new package version
post_install() {
  if [ ! "`grep -s openssl_gost /etc/ssl/openssl.cnf`" ]; then
    _helpline
  fi
  enginesdir=`openssl version -e|perl -ne '/^ENGINESDIR: "(.+)"$/; print $1'`
  echo "
      Checks after installation:
      $enginesdir should contains the file "gost.so"
  "
}

## arg 1:  the new package version
## arg 2:  the old package version
#pre_upgrade() {
  # do something here
#}

## arg 1:  the new package version
## arg 2:  the old package version
post_upgrade() {
  if [ ! "`grep -s openssl_gost /etc/ssl/openssl.cnf`" ]; then
    _helpline
  fi
  enginesdir=`openssl version -e|perl -ne '/^ENGINESDIR: "(.+)"$/; print $1'`
  echo "
      Checks after installation:
      $enginesdir should contains the file "gost.so"
  "
}

## arg 1:  the old package version
#pre_remove() {
  # do something here
#}

## arg 1:  the old package version
post_remove() {
  if [ "`grep openssl_gost /etc/ssl/openssl.cnf`" ]; then
    echo "

      Do not forget to modify your /etc/ssl/openssl.cnf

    "
  fi
}