tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
cie-middleware-linux: 1.5.0 -> 1.5.2
rnhmjoj
2 years ago
64b487bb
d9bb2c01
+352
-32
2 changed files
expand all
collapse all
unified
split
pkgs
tools
security
cie-middleware-linux
default.nix
use-system-podofo.patch
+9
-32
pkgs/tools/security/cie-middleware-linux/default.nix
···
1
1
{ stdenv
2
2
, lib
3
3
, fetchFromGitHub
4
4
-
, fetchpatch
5
4
, makeWrapper
6
6
-
, strip-nondeterminism
5
5
+
, stripJavaArchivesHook
7
6
, meson
8
7
, ninja
9
8
, pkg-config
10
10
-
, gradle_7
9
9
+
, gradle_8
11
10
, curl
12
11
, cryptopp
13
12
, fontconfig
···
21
20
22
21
let
23
22
pname = "cie-middleware-linux";
24
24
-
version = "1.5.0";
23
23
+
version = "1.5.2";
25
24
26
25
src = fetchFromGitHub {
27
26
owner = "M0rf30";
28
27
repo = pname;
29
28
rev = version;
30
30
-
sha256 = "sha256-Z8K2Ibg5bBfSql5HEapKgdfiCf/EIKTTD15oVeysQGk=";
29
29
+
sha256 = "sha256-M3Xwg3G2ZZhPRV7uhFVXQPyvuuY4zI5Z+D/Dt26KVM0=";
31
30
};
32
31
33
33
-
gradle = gradle_7;
32
32
+
gradle = gradle_8;
34
33
35
34
# Shared libraries needed by the Java application
36
35
libraries = lib.makeLibraryPath [ ghostscript ];
···
45
44
buildPhase = ''
46
45
# Run the fetchDeps task
47
46
export GRADLE_USER_HOME=$(mktemp -d)
48
48
-
ls -l
49
47
gradle --no-daemon -b cie-java/build.gradle fetchDeps
50
48
'';
51
49
···
62
60
63
61
outputHashAlgo = "sha256";
64
62
outputHashMode = "recursive";
65
65
-
outputHash = "sha256-jtaH8dBpnx8KMJe+jzJfkvcx1NO4nL5jsRO4+GI+d0c=";
63
63
+
outputHash = "sha256-fxrjo4iduXzTgMqmQGwdI1vLMA4EZLObsHyKGZ6b14I=";
66
64
};
67
65
68
66
in
···
71
69
inherit pname src version;
72
70
73
71
hardeningDisable = [ "format" ];
74
74
-
75
75
-
outputs = [ "out" "dev" ];
76
72
77
73
nativeBuildInputs = [
78
74
makeWrapper
75
75
+
stripJavaArchivesHook
79
76
meson
80
77
ninja
81
78
pkg-config
82
79
gradle
83
83
-
strip-nondeterminism
84
80
];
85
81
86
82
buildInputs = [
87
83
cryptopp
88
84
fontconfig
89
89
-
podofo.dev
85
85
+
podofo
90
86
openssl
91
87
pcsclite
92
88
curl
93
89
libxml2
94
90
];
95
91
96
96
-
patches = [
97
97
-
# Fix gcc-13 build by adding missing include.
98
98
-
(fetchpatch {
99
99
-
name = "gcc-13.patch";
100
100
-
url = "https://github.com/M0Rf30/cie-middleware-linux/commit/1da1196152f7a3bbe92ba3ce993ebb6785ff049e.patch";
101
101
-
hash = "sha256-aM23A1ZX8kebgX6RXVS78SEa+to93glUmIYO+lfUzfg=";
102
102
-
})
103
103
-
];
92
92
+
patches = [ ./use-system-podofo.patch ];
104
93
105
94
postPatch = ''
106
95
# substitute the cieid command with this $out/bin/cieid
107
96
substituteInPlace libs/pkcs11/src/CSP/AbilitaCIE.cpp \
108
97
--replace 'file = "cieid"' 'file = "'$out'/bin/cieid"'
109
109
-
110
110
-
# revert https://github.com/M0Rf30/cie-middleware-linux/commit/1a389d8
111
111
-
sed -i libs/meson.build \
112
112
-
-e "s@podofo_dep = .\+@podofo_dep = dependency('libpodofo')@g"
113
98
'';
114
99
115
100
# Note: we use pushd/popd to juggle between the
···
157
142
install -Dm644 data/cieid.desktop "$out/share/applications/cieid.desktop"
158
143
install -Dm755 data/logo.png "$out/share/pixmaps/cieid.png"
159
144
install -Dm644 LICENSE "$out/share/licenses/cieid/LICENSE"
160
160
-
'';
161
161
-
162
162
-
postFixup = ''
163
163
-
# Move static libraries to the dev output
164
164
-
mv -t "$dev/lib" "$out/lib/"*.a
165
165
-
166
166
-
# Make the jar deterministic (mainly, sorting its files)
167
167
-
strip-nondeterminism "$out/share/cieid/cieid.jar"
168
145
'';
169
146
170
147
passthru = { inherit javaDeps; };
+343
pkgs/tools/security/cie-middleware-linux/use-system-podofo.patch
···
1
1
+
commit c9ac4243a6def08790bbf5552bb31894169596ca
2
2
+
Author: rnhmjoj <rnhmjoj@inventati.org>
3
3
+
Date: Wed Apr 3 12:54:58 2024 +0200
4
4
+
5
5
+
use system podofo
6
6
+
7
7
+
diff --git a/libs/meson.build b/libs/meson.build
8
8
+
index 3ee31c1..5022ba8 100644
9
9
+
--- a/libs/meson.build
10
10
+
+++ b/libs/meson.build
11
11
+
@@ -16,21 +16,15 @@ curl_dep = dependency('libcurl')
12
12
+
fontconfig_dep = dependency('fontconfig')
13
13
+
freetype_dep = dependency('freetype2')
14
14
+
png_dep = dependency('libpng')
15
15
+
-podofo_dep = cpp.find_library('libpodofo', dirs: libdir)
16
16
+
+podofo_dep = dependency('libpodofo')
17
17
+
libxml2_dep = dependency('libxml-2.0', required: false)
18
18
+
xml2_dep = dependency('xml2', required: false)
19
19
+
zlib_dep = dependency('zlib')
20
20
+
21
21
+
inc_so = include_directories('pkcs11/src/.', 'shared/src/')
22
22
+
23
23
+
-inc_a = include_directories(
24
24
+
- 'sign-sdk/include',
25
25
+
- 'sign-sdk/include/podofo',
26
26
+
- 'sign-sdk/include/podofo/include',
27
27
+
- 'sign-sdk/include/podofo/include/podofo',
28
28
+
- 'sign-sdk/src',
29
29
+
- 'shared/src/',
30
30
+
-)
31
31
+
+inc_a = include_directories('sign-sdk/include', 'sign-sdk/src', 'shared/src/')
32
32
+
+
33
33
+
cie_pkcs11_sources = [
34
34
+
'shared/src/Util/log.cpp',
35
35
+
'shared/src/Util/funccallinfo.cpp',
36
36
+
diff --git a/libs/sign-sdk/include/PdfSignatureGenerator.h b/libs/sign-sdk/include/PdfSignatureGenerator.h
37
37
+
index 93ab445..65d438f 100644
38
38
+
--- a/libs/sign-sdk/include/PdfSignatureGenerator.h
39
39
+
+++ b/libs/sign-sdk/include/PdfSignatureGenerator.h
40
40
+
@@ -10,9 +10,7 @@
41
41
+
#ifndef _PDFSIGNATUREGENERATOR_H_
42
42
+
#define _PDFSIGNATUREGENERATOR_H_
43
43
+
#include "Util/UUCByteArray.h"
44
44
+
-#include "podofo/doc/PdfSignOutputDevice.h"
45
45
+
-#include "podofo/doc/PdfSignatureField.h"
46
46
+
-#include "podofo/podofo.h"
47
47
+
+#include <podofo/podofo.h>
48
48
+
49
49
+
using namespace PoDoFo;
50
50
+
using namespace std;
51
51
+
@@ -60,7 +58,11 @@ class PdfSignatureGenerator {
52
52
+
const double getHeight(int pageIndex);
53
53
+
54
54
+
private:
55
55
+
- PdfMemDocument* m_pPdfDocument;
56
56
+
+ PdfDocument* m_pPdfDocument;
57
57
+
+
58
58
+
+ PdfMemDocument* m_pPdfMemDocument;
59
59
+
+
60
60
+
+ PdfWriter* m_pPdfWriter;
61
61
+
62
62
+
PdfSignatureField* m_pSignatureField;
63
63
+
64
64
+
diff --git a/libs/sign-sdk/src/PdfSignatureGenerator.cpp b/libs/sign-sdk/src/PdfSignatureGenerator.cpp
65
65
+
index 44ef54a..e8b8c8e 100644
66
66
+
--- a/libs/sign-sdk/src/PdfSignatureGenerator.cpp
67
67
+
+++ b/libs/sign-sdk/src/PdfSignatureGenerator.cpp
68
68
+
@@ -27,7 +27,7 @@ int GetNumberOfSignatures(PdfMemDocument* pPdfDocument);
69
69
+
USE_LOG;
70
70
+
71
71
+
PdfSignatureGenerator::PdfSignatureGenerator()
72
72
+
- : m_pPdfDocument(NULL),
73
73
+
+ : m_pPdfMemDocument(NULL),
74
74
+
m_pSignatureField(NULL),
75
75
+
m_pSignOutputDevice(NULL),
76
76
+
m_pFinalOutDevice(NULL),
77
77
+
@@ -37,7 +37,7 @@ PdfSignatureGenerator::PdfSignatureGenerator()
78
78
+
}
79
79
+
80
80
+
PdfSignatureGenerator::~PdfSignatureGenerator() {
81
81
+
- if (m_pPdfDocument) delete m_pPdfDocument;
82
82
+
+ if (m_pPdfMemDocument) delete m_pPdfMemDocument;
83
83
+
84
84
+
if (m_pSignatureField) delete m_pSignatureField;
85
85
+
86
86
+
@@ -51,21 +51,21 @@ PdfSignatureGenerator::~PdfSignatureGenerator() {
87
87
+
}
88
88
+
89
89
+
int PdfSignatureGenerator::Load(const char* pdf, int len) {
90
90
+
- if (m_pPdfDocument) delete m_pPdfDocument;
91
91
+
+ if (m_pPdfMemDocument) delete m_pPdfMemDocument;
92
92
+
93
93
+
try {
94
94
+
printf("PDF LENGTH");
95
95
+
printf("%i", len);
96
96
+
printf("STOP");
97
97
+
98
98
+
- m_pPdfDocument = new PdfMemDocument();
99
99
+
- m_pPdfDocument->Load(pdf, len);
100
100
+
- printf("OK m_pPdfDocument");
101
101
+
- int nSigns = PDFVerifier::GetNumberOfSignatures(m_pPdfDocument);
102
102
+
+ m_pPdfMemDocument = new PdfMemDocument();
103
103
+
+ m_pPdfMemDocument->Load(pdf);
104
104
+
+ printf("OK m_pPdfMemDocument");
105
105
+
+ int nSigns = PDFVerifier::GetNumberOfSignatures(m_pPdfMemDocument);
106
106
+
printf("OK nSigns: %d", nSigns);
107
107
+
108
108
+
if (nSigns > 0) {
109
109
+
- m_pPdfDocument->SetIncrementalUpdates(true);
110
110
+
+ m_pPdfWriter->PdfWriter::SetIncrementalUpdate(true);
111
111
+
}
112
112
+
m_actualLen = len;
113
113
+
114
114
+
@@ -82,14 +82,8 @@ void PdfSignatureGenerator::AddFont(const char* szFontName,
115
115
+
// printf(szFontName);
116
116
+
// printf(szFontPath);
117
117
+
118
118
+
- m_pPdfDocument->CreateFont(
119
119
+
- szFontName, false, false,
120
120
+
- PdfEncodingFactory::GlobalWinAnsiEncodingInstance(),
121
121
+
- PdfFontCache::eFontCreationFlags_AutoSelectBase14, true, szFontPath);
122
122
+
- m_pPdfDocument->CreateFont(
123
123
+
- szFontName, true, false,
124
124
+
- PdfEncodingFactory::GlobalWinAnsiEncodingInstance(),
125
125
+
- PdfFontCache::eFontCreationFlags_AutoSelectBase14, true, szFontPath);
126
126
+
+ m_pPdfDocument->PoDoFo::PdfDocument::CreateFont( szFontName, false, PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), PdfFontCache::eFontCreationFlags_AutoSelectBase14, true);
127
127
+
+ m_pPdfDocument->PoDoFo::PdfDocument::CreateFont( szFontName, true, PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), PdfFontCache::eFontCreationFlags_AutoSelectBase14, true);
128
128
+
}
129
129
+
130
130
+
void PdfSignatureGenerator::InitSignature(
131
131
+
@@ -130,7 +124,7 @@ void PdfSignatureGenerator::InitSignature(
132
132
+
133
133
+
if (m_pSignatureField) delete m_pSignatureField;
134
134
+
135
135
+
- PdfPage* pPage = m_pPdfDocument->GetPage(pageIndex);
136
136
+
+ PdfPage* pPage = m_pPdfMemDocument->GetPage(pageIndex);
137
137
+
PdfRect cropBox = pPage->GetCropBox();
138
138
+
139
139
+
float left0 = left * cropBox.GetWidth();
140
140
+
@@ -145,15 +139,14 @@ void PdfSignatureGenerator::InitSignature(
141
141
+
142
142
+
LOG_DBG((0, "InitSignature", "PdfSignatureField"));
143
143
+
144
144
+
- m_pSignatureField = new PdfSignatureField(
145
145
+
- pPage, rect, m_pPdfDocument, PdfString(szFieldName), szSubFilter);
146
146
+
+ m_pSignatureField = new PdfSignatureField(pPage, rect, m_pPdfMemDocument);
147
147
+
148
148
+
LOG_DBG((0, "InitSignature", "PdfSignatureField OK"));
149
149
+
150
150
+
if (szReason && szReason[0]) {
151
151
+
PdfString reason(szReason);
152
152
+
PdfString reasonLabel(szReasonLabel);
153
153
+
- m_pSignatureField->SetSignatureReason(reasonLabel, reason);
154
154
+
+ m_pSignatureField->SetSignatureReason(reason);
155
155
+
}
156
156
+
157
157
+
LOG_DBG((0, "InitSignature", "szReason OK"));
158
158
+
@@ -161,7 +154,7 @@ void PdfSignatureGenerator::InitSignature(
159
159
+
if (szLocation && szLocation[0]) {
160
160
+
PdfString location(szLocation);
161
161
+
PdfString locationLabel(szLocationLabel);
162
162
+
- m_pSignatureField->SetSignatureLocation(locationLabel, location);
163
163
+
+ m_pSignatureField->SetSignatureLocation(location);
164
164
+
}
165
165
+
166
166
+
LOG_DBG((0, "InitSignature", "szLocation OK"));
167
167
+
@@ -171,54 +164,42 @@ void PdfSignatureGenerator::InitSignature(
168
168
+
169
169
+
LOG_DBG((0, "InitSignature", "Date OK"));
170
170
+
171
171
+
- if (szName && szName[0]) {
172
172
+
- PdfString name(szName);
173
173
+
- PdfString nameLabel(szNameLabel);
174
174
+
- m_pSignatureField->SetSignatureName(nameLabel, name);
175
175
+
- }
176
176
+
-
177
177
+
- LOG_DBG((0, "InitSignature", "szName OK"));
178
178
+
-
179
179
+
- m_pSignatureField->SetSignatureSize(SIGNATURE_SIZE);
180
180
+
+ m_pSignOutputDevice->PdfSignOutputDevice::SetSignatureSize(SIGNATURE_SIZE);
181
181
+
182
182
+
LOG_DBG((0, "InitSignature", "SIGNATURE_SIZE OK"));
183
183
+
184
184
+
- // if((szImagePath && szImagePath[0]) || (szDescription && szDescription[0]))
185
185
+
- if (width * height > 0) {
186
186
+
- try {
187
187
+
- // m_pSignatureField->SetFontSize(5);
188
188
+
- m_pSignatureField->SetAppearance(szImagePath, szDescription);
189
189
+
- LOG_DBG((0, "InitSignature", "SetAppearance OK"));
190
190
+
- } catch (PdfError& error) {
191
191
+
- LOG_ERR((0, "InitSignature", "SetAppearance error: %s, %s",
192
192
+
- PdfError::ErrorMessage(error.GetError()), error.what()));
193
193
+
- } catch (PdfError* perror) {
194
194
+
- LOG_ERR((0, "InitSignature", "SetAppearance error2: %s, %s",
195
195
+
- PdfError::ErrorMessage(perror->GetError()), perror->what()));
196
196
+
- } catch (std::exception& ex) {
197
197
+
- LOG_ERR(
198
198
+
- (0, "InitSignature", "SetAppearance std exception, %s", ex.what()));
199
199
+
- } catch (std::exception* pex) {
200
200
+
- LOG_ERR((0, "InitSignature", "SetAppearance std exception2, %s",
201
201
+
- pex->what()));
202
202
+
- } catch (...) {
203
203
+
- LOG_ERR((0, "InitSignature", "SetAppearance unknown error"));
204
204
+
- }
205
205
+
- }
206
206
+
+ // if (width * height > 0) {
207
207
+
+ // try {
208
208
+
+ // m_pSignatureField->SetAppearance(szImagePath, szDescription);
209
209
+
+ // LOG_DBG((0, "InitSignature", "SetAppearance OK"));
210
210
+
+ // } catch (PdfError& error) {
211
211
+
+ // LOG_ERR((0, "InitSignature", "SetAppearance error: %s, %s",
212
212
+
+ // PdfError::ErrorMessage(error.GetError()), error.what()));
213
213
+
+ // } catch (PdfError* perror) {
214
214
+
+ // LOG_ERR((0, "InitSignature", "SetAppearance error2: %s, %s",
215
215
+
+ // PdfError::ErrorMessage(perror->GetError()), perror->what()));
216
216
+
+ // } catch (std::exception& ex) {
217
217
+
+ // LOG_ERR(
218
218
+
+ // (0, "InitSignature", "SetAppearance std exception, %s",
219
219
+
+ // ex.what()));
220
220
+
+ // } catch (std::exception* pex) {
221
221
+
+ // LOG_ERR((0, "InitSignature", "SetAppearance std exception2, %s",
222
222
+
+ // pex->what()));
223
223
+
+ // } catch (...) {
224
224
+
+ // LOG_ERR((0, "InitSignature", "SetAppearance unknown error"));
225
225
+
+ // }
226
226
+
+ // }
227
227
+
228
228
+
- if (szGraphometricData && szGraphometricData[0])
229
229
+
- m_pSignatureField->SetGraphometricData(
230
230
+
- PdfString("Aruba_Sign_Biometric_Data"), PdfString(szGraphometricData),
231
231
+
- PdfString(szVersion));
232
232
+
+ // if (szGraphometricData && szGraphometricData[0])
233
233
+
+ // m_pSignatureField->SetGraphometricData(
234
234
+
+ // PdfString("Aruba_Sign_Biometric_Data"),
235
235
+
+ // PdfString(szGraphometricData), PdfString(szVersion));
236
236
+
237
237
+
- LOG_DBG((0, "InitSignature", "szGraphometricData OK"));
238
238
+
+ // LOG_DBG((0, "InitSignature", "szGraphometricData OK"));
239
239
+
240
240
+
LOG_DBG((0, "InitSignature", "m_actualLen %d", m_actualLen));
241
241
+
// crea il nuovo doc con il campo di firma
242
242
+
- int fulllen = m_actualLen * 2 + SIGNATURE_SIZE * 2 +
243
243
+
- (szGraphometricData
244
244
+
- ? (strlen(szGraphometricData) + strlen(szVersion) + 100)
245
245
+
- : 0);
246
246
+
+ int fulllen = m_actualLen * 2 + SIGNATURE_SIZE * 2;
247
247
+
248
248
+
int mainDoclen = 0;
249
249
+
m_pMainDocbuffer = NULL;
250
250
+
@@ -227,7 +208,7 @@ void PdfSignatureGenerator::InitSignature(
251
251
+
LOG_DBG((0, "InitSignature", "fulllen %d", fulllen));
252
252
+
m_pMainDocbuffer = new char[fulllen];
253
253
+
PdfOutputDevice pdfOutDevice(m_pMainDocbuffer, fulllen);
254
254
+
- m_pPdfDocument->Write(&pdfOutDevice);
255
255
+
+ m_pPdfMemDocument->Write(&pdfOutDevice);
256
256
+
mainDoclen = pdfOutDevice.GetLength();
257
257
+
} catch (::PoDoFo::PdfError err) {
258
258
+
if (m_pMainDocbuffer) {
259
259
+
@@ -301,32 +282,32 @@ void PdfSignatureGenerator::GetSignedPdf(UUCByteArray& signedPdf) {
260
260
+
}
261
261
+
262
262
+
const double PdfSignatureGenerator::getWidth(int pageIndex) {
263
263
+
- if (m_pPdfDocument) {
264
264
+
- PdfPage* pPage = m_pPdfDocument->GetPage(pageIndex);
265
265
+
+ if (m_pPdfMemDocument) {
266
266
+
+ PdfPage* pPage = m_pPdfMemDocument->GetPage(pageIndex);
267
267
+
return pPage->GetPageSize().GetWidth();
268
268
+
}
269
269
+
return 0;
270
270
+
}
271
271
+
272
272
+
const double PdfSignatureGenerator::getHeight(int pageIndex) {
273
273
+
- if (m_pPdfDocument) {
274
274
+
- PdfPage* pPage = m_pPdfDocument->GetPage(pageIndex);
275
275
+
+ if (m_pPdfMemDocument) {
276
276
+
+ PdfPage* pPage = m_pPdfMemDocument->GetPage(pageIndex);
277
277
+
return pPage->GetPageSize().GetHeight();
278
278
+
}
279
279
+
return 0;
280
280
+
}
281
281
+
282
282
+
const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
283
283
+
- if (!m_pPdfDocument) return -1;
284
284
+
+ if (!m_pPdfMemDocument) return -1;
285
285
+
/// Find the document catalog dictionary
286
286
+
- const PdfObject* const trailer = m_pPdfDocument->GetTrailer();
287
287
+
+ const PdfObject* const trailer = m_pPdfMemDocument->GetTrailer();
288
288
+
if (!trailer->IsDictionary()) return -1;
289
289
+
const PdfObject* const catalogRef =
290
290
+
trailer->GetDictionary().GetKey(PdfName("Root"));
291
291
+
if (catalogRef == 0 || !catalogRef->IsReference())
292
292
+
return -2; // throw std::invalid_argument("Invalid /Root entry");
293
293
+
const PdfObject* const catalog =
294
294
+
- m_pPdfDocument->GetObjects().GetObject(catalogRef->GetReference());
295
295
+
+ m_pPdfMemDocument->GetObjects().GetObject(catalogRef->GetReference());
296
296
+
if (catalog == 0 || !catalog->IsDictionary())
297
297
+
return -3; // throw std::invalid_argument("Invalid or non-dictionary
298
298
+
// referenced by /Root entry");
299
299
+
@@ -336,8 +317,8 @@ const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
300
300
+
catalog->GetDictionary().GetKey(PdfName("AcroForm"));
301
301
+
if (acroFormValue == 0) return bottom;
302
302
+
if (acroFormValue->IsReference())
303
303
+
- acroFormValue =
304
304
+
- m_pPdfDocument->GetObjects().GetObject(acroFormValue->GetReference());
305
305
+
+ acroFormValue = m_pPdfMemDocument->GetObjects().GetObject(
306
306
+
+ acroFormValue->GetReference());
307
307
+
308
308
+
if (!acroFormValue->IsDictionary()) return bottom;
309
309
+
310
310
+
@@ -346,8 +327,8 @@ const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
311
311
+
if (fieldsValue == 0) return bottom;
312
312
+
313
313
+
if (fieldsValue->IsReference())
314
314
+
- fieldsValue =
315
315
+
- m_pPdfDocument->GetObjects().GetObject(acroFormValue->GetReference());
316
316
+
+ fieldsValue = m_pPdfMemDocument->GetObjects().GetObject(
317
317
+
+ acroFormValue->GetReference());
318
318
+
319
319
+
if (!fieldsValue->IsArray()) return bottom;
320
320
+
321
321
+
@@ -360,8 +341,8 @@ const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
322
322
+
323
323
+
for (unsigned int i = 0; i < array.size(); i++) {
324
324
+
const PdfObject* pObj =
325
325
+
- m_pPdfDocument->GetObjects().GetObject(array[i].GetReference());
326
326
+
- if (IsSignatureField(m_pPdfDocument, pObj)) {
327
327
+
+ m_pPdfMemDocument->GetObjects().GetObject(array[i].GetReference());
328
328
+
+ if (IsSignatureField(m_pPdfMemDocument, pObj)) {
329
329
+
const PdfObject* const keyRect =
330
330
+
pObj->GetDictionary().GetKey(PdfName("Rect"));
331
331
+
if (keyRect == 0) {
332
332
+
diff --git a/libs/sign-sdk/src/disigonsdk.cpp b/libs/sign-sdk/src/disigonsdk.cpp
333
333
+
index 250c93f..84e1b0b 100644
334
334
+
--- a/libs/sign-sdk/src/disigonsdk.cpp
335
335
+
+++ b/libs/sign-sdk/src/disigonsdk.cpp
336
336
+
@@ -5,6 +5,7 @@
337
337
+
338
338
+
#include <libxml/tree.h>
339
339
+
#include <libxml/xmlmemory.h>
340
340
+
+#include <podofo/podofo.h>
341
341
+
#include <stdlib.h>
342
342
+
#include <string.h>
343
343
+