<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>37922</bug_id>
          
          <creation_ts>2020-01-24 17:36:43 +0300</creation_ts>
          <short_desc>control openssl-gost портит openssl.cnf</short_desc>
          <delta_ts>2020-11-13 14:11:52 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>openssl-gost-engine</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Slava Aseev">ptrnine</reporter>
          <assigned_to name="manowar@altlinux.org">manowar</assigned_to>
          <cc>aen</cc>
    
    <cc>cas</cc>
    
    <cc>glebfm</cc>
    
    <cc>manowar</cc>
    
    <cc>ptrnine</cc>
    
    <cc>rider</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>187230</commentid>
    <comment_count>0</comment_count>
    <who name="Slava Aseev">ptrnine</who>
    <bug_when>2020-01-24 17:36:43 +0300</bug_when>
    <thetext>сontrol openssl-gost портит openssl.cnf, если он содержит в начале параметры без секции.

Происходит это потому что скрипт вставляет в начало openssl.cnf вот это:

openssl_conf = openssl_def
[ openssl_def ]
engines = engine_section

и все параметры в начале файла без секции теперь входят в [ openssl_def ]


Проявилось вот так:

openssl enc -ciphers

Supported ciphers:
..................
-rc2-64-cbc                -rc2-cbc                   -rc2-cfb                  
-rc2-ecb                   -rc2-ofb                   -rc4                      
-rc4-40                    -seed                      -seed-cbc                 
-se140158277650240:error:25066067:DSO support routines:dlfcn_load:could not load the shared library:crypto/dso/dso_dlfcn.c:118:filename(libHOME.so): libHOME.so: cannot open shared object file: No such file or directory
140158277650240:error:25070067:DSO support routines:DSO_load:could not load the shared library:crypto/dso/dso_lib.c:162:
140158277650240:error:0E07506E:configuration file routines:module_load_dso:error loading dso:crypto/conf/conf_mod.c:224:module=HOME, path=HOME
140158277650240:error:0E076071:configuration file routines:module_run:unknown module name:crypto/conf/conf_mod.c:165:module=HOME
ed-cfb                  -seed-ecb                  -seed-ofb                 
-sm4                       -sm4-cbc                   -sm4-cfb                  
-sm4-ctr                   -sm4-ecb                   -sm4-ofb</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187238</commentid>
    <comment_count>1</comment_count>
    <who name="manowar@altlinux.org">manowar</who>
    <bug_when>2020-01-24 20:29:59 +0300</bug_when>
    <thetext>Принципиально, я не против переделать скрипт. Но мне нужно какое-то доказательство, что при наличии строчки openssl_conf=секция, параметры, как вы правильно указали, вне всякой секции вообще учитываются OpenSSL. Мне кажется, что openssl_conf=секция говорит OpenSSL, что &quot;конфиг теперь начинается с &lt;секция&gt;, а всё, что выше, нужно отбросить&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187324</commentid>
    <comment_count>2</comment_count>
    <who name="Slava Aseev">ptrnine</who>
    <bug_when>2020-01-29 12:32:52 +0300</bug_when>
    <thetext>(Ответ для manowar@altlinux.org на комментарий #1)
&gt; Принципиально, я не против переделать скрипт. Но мне нужно какое-то
&gt; доказательство, что при наличии строчки openssl_conf=секция, параметры, как
&gt; вы правильно указали, вне всякой секции вообще учитываются OpenSSL. Мне
&gt; кажется, что openssl_conf=секция говорит OpenSSL, что &quot;конфиг теперь
&gt; начинается с &lt;секция&gt;, а всё, что выше, нужно отбросить&quot;.

Тут как раз таки проблема в том, что параметры, которые были глобальными, после отработки скрипта теперь входят в openssl_conf.

Вот начало конфига с пометками, чтоб было понятнее: 

openssl_conf = openssl_def    #### Эти строки были вставлены скриптом
[ openssl_def ]
engines = engine_section
#                                        #### Файл раньше начинался вот здесь
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#

# Note that you can include other files from the main configuration
# file using the .include directive.
#.include filename

# This definition stops the following lines choking if HOME isn&apos;t
# defined.
HOME			= . #### упс, кажется этот был параметр без секции, а теперь входит в [ openssl_def ]

# Extra OBJECT IDENTIFIER info:
#oid_file		= $ENV::HOME/.oid
oid_section		= new_oids       #### и этот тоже

# To use this configuration file with the &quot;-extfile&quot; option of the
# &quot;openssl x509&quot; utility, name here the section containing the
# X.509v3 extensions to use:
# extensions		=
# (Alternatively, use a configuration file that has only
# X.509v3 extensions in its main [= default] section.)


[ new_oids ]
.....................


То есть, параметры HOME и old_section теперь попадают в [ openssl_def ], хотя были глобальными</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190364</commentid>
    <comment_count>3</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2020-05-27 20:05:11 +0300</bug_when>
    <thetext>ping</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190370</commentid>
    <comment_count>4</comment_count>
    <who name="manowar@altlinux.org">manowar</who>
    <bug_when>2020-05-28 11:51:22 +0300</bug_when>
    <thetext>Хорошо. Я сейчас проверю отладчиком как раз на &quot;oid_section&quot;. Если выяснится, что он читается только вне всякой секции, то поправлю контрол.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190394</commentid>
    <comment_count>5</comment_count>
    <who name="manowar@altlinux.org">manowar</who>
    <bug_when>2020-05-29 14:52:19 +0300</bug_when>
    <thetext>Да, действительно, секция [ openssl_def ], объявленная в самом начале ломает нормальное чтение конфига. И я нашёл два способа починить это. Самый простой заключается в том, чтобы просто назвать эту первую секцию специальным именем [ default ]. Тогда &quot;глобальные&quot; переменные читаются. В итоге будет:

    openssl_conf = default
    [ default ]
    engines = engines_section
    ...
    # и дальше исходный файл, затем
    ...
    [ engines_section ]
    # и всё гостовое

Второй способ заключается в том, чтобы назвать секцию, где объявляются engines другим именем (имя default использовать в этом случае нельзя) и поместить эту секцию в середину или же в конец:

    # OpenSSL example configuration file.
    # и дальше исходный файл, затем
    ...
    openssl_conf = default_modules
    [ default_modules ]
    engines = engines_section
    [ engines_section ]
    # и всё гостовое

Какой вариант больше нравится?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190395</commentid>
    <comment_count>6</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2020-05-29 14:56:24 +0300</bug_when>
    <thetext>по мне так оба варианта выглядят рабочими. 

Просто исходя из того, что использование секции default выглядит костылём, я бы предпочёл объявление в конце файла с другим именем.

Но тебе виднее, как мне кажется.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190396</commentid>
    <comment_count>7</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2020-05-29 15:32:15 +0300</bug_when>
    <thetext>(Ответ для manowar@altlinux.org на комментарий #5)

Лучше в конец.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190466</commentid>
    <comment_count>8</comment_count>
    <who name="manowar@altlinux.org">manowar</who>
    <bug_when>2020-06-01 20:36:59 +0300</bug_when>
    <thetext>http://git.altlinux.org/tasks/252666/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192844</commentid>
    <comment_count>9</comment_count>
    <who name="manowar@altlinux.org">manowar</who>
    <bug_when>2020-09-25 14:43:41 +0300</bug_when>
    <thetext>(In reply to manowar@altlinux.org from comment #8)
&gt; http://git.altlinux.org/tasks/252666/

Ping? Если новое поведение подходит, то мне нужен approve, чтобы наконец обновить в Сизифе.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>194189</commentid>
    <comment_count>10</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2020-11-13 12:54:59 +0300</bug_when>
    <thetext>Ping</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>194191</commentid>
    <comment_count>11</comment_count>
    <who name="manowar@altlinux.org">manowar</who>
    <bug_when>2020-11-13 13:04:45 +0300</bug_when>
    <thetext>$ ssh girar task show 252666
id=252666 locked=no shared=no fail_early=yes test_only=yes repo=sisyphus owner=manowar state=EPERM try=1 iter=1 age=23w build_time=2020-Jun-01/17:42:03
 100:dir=/people/manowar/packages/openssl-gost-engine.git
 100:tag_name=v1.1.0.3.0.255.ge3af41d.p1-alt3
 100:tag_id=167c32d1e5f49908d58d8fbd7f3786fb7b6d7d84
 100:tag_author=Paul Wolneykien &lt;manowar@altlinux.org&gt;
 100:fetched=2020-06-01T17:35:22
 100:userid=manowar
 100:pkgname=openssl-gost-engine

$ ssh girar acl sisyphus openssl-gost-engine show
openssl-gost-engine     glebfm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>194192</commentid>
    <comment_count>12</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2020-11-13 14:11:52 +0300</bug_when>
    <thetext>openssl-gost-engine-1.1.0.3.0.255.ge3af41d.p1-alt3 -&gt; sisyphus:

 Mon Jun 01 2020 Paul Wolneykien &lt;manowar@altlinux&gt; 1.1.0.3.0.255.ge3af41d.p1-alt3
 - Fix for the &quot;openssl-gost&apos; control: Don&apos;t override the main section
   (closes: 37922).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>