pkcs: extract PBE-based encryption and decryption functions

Extract internal functions used by both PKCS#12 and PKCS#8 to handle
PBE-based encryption of the data.

Signed-off-by: Dmitry Baryshkov <[email protected]>
25 jobs for tmp-cms-support in 109 minutes and 7 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Stage1 Testing
passed #567355089
linux docker shared
Debian.cross.aarch64-linux-gnu

01:06:49

passed #567355087
linux docker shared
Debian.cross.arm-linux-gnueabihf

01:19:55

passed #567355071
linux docker shared
Debian.cross.i686-linux-gnu

00:32:34

passed #567355088
linux docker shared
Debian.cross.mips-linux-gnu

01:10:48

passed #567355070
linux shared
Debian.x86_64

00:29:16

passed #567573197
shared linux
FIPS140-2.Fedora.x86_64

00:29:07

passed #567355067
freebsd
FreeBSD.x86_64

00:35:18

passed #567355065
linux docker shared
MinGW32

00:26:02

passed #567355063
linux docker shared
MinGW64

00:22:44

passed #567355055
linux shared
SSL-3.0.Fedora.x86_64

00:28:26

passed #567355069
linux shared
UB+ASAN-Werror.Fedora.x86_64.gcc

00:44:59

passed #567355046
linux shared
abi/coverage

00:30:35

76.8%
passed #567355039
commit-check

00:00:52

failed #567389408
shared linux
doc-dist.Fedora

00:17:51

passed #567355053
linux shared
minimal.Fedora.x86_64

00:20:08

passed #567355091
linux shared
nettle-master-minigmp.Fedora

00:23:21

passed #567355090
linux shared
nettle-master.Fedora

00:51:05

passed #567355061
linux shared
static-analyzers.Fedora.x86_64

00:27:21

passed #567355059
linux shared
threadsan.Fedora.x86_64

00:12:47

passed #567355057
linux shared
valgrind.Fedora.x86_64

00:52:50

failed #567355056
linux shared
FIPS140-2.Fedora.x86_64

02:00:00

failed #567355043
linux shared
doc-dist.Fedora

00:17:36

 
  External
failed Codacy/PR Quality Review

passed LGTM analysis: C/C++

00:25:11

passed LGTM analysis: JavaScript

00:05:37

 
Name Stage Failure
failed
doc-dist.Fedora Stage1 Testing
bad compiler arguments               986
autoconf compile/link 132160
no input file 3864
cleanups performed 24
files in cache 73463
cache size 4.6 GB
max cache size 5.0 GB
Uploading artifacts for failed job
ERROR: Job failed: exit code 1