You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

363 lines
13 KiB

  1. #include <config.h>
  2. #include <apt-pkg/error.h>
  3. #include <apt-pkg/fileutl.h>
  4. #include <apt-pkg/gpgv.h>
  5. #include <string>
  6. #include <gtest/gtest.h>
  7. #include "file-helpers.h"
  8. /* The test files are created with the 'Joe Sixpack' and 'Marvin Paranoid'
  9. test key included in the integration testing framework */
  10. TEST(OpenMaybeClearSignedFileTest,SimpleSignedFile)
  11. {
  12. std::string tempfile;
  13. FileFd fd;
  14. // Using c++11 raw-strings would be nifty, but travis doesn't support it…
  15. createTemporaryFile("simplesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n"
  16. "Hash: SHA512\n"
  17. "\n"
  18. "Test\n"
  19. "-----BEGIN PGP SIGNATURE-----\n"
  20. "\n"
  21. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  22. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  23. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  24. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  25. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  26. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  27. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  28. "=TB1F\n"
  29. "-----END PGP SIGNATURE-----\n");
  30. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  31. EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd));
  32. if (tempfile.empty() == false)
  33. unlink(tempfile.c_str());
  34. EXPECT_TRUE(fd.IsOpen());
  35. char buffer[100];
  36. EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer)));
  37. EXPECT_STREQ(buffer, "Test");
  38. EXPECT_TRUE(fd.Eof());
  39. }
  40. TEST(OpenMaybeClearSignedFileTest,WhitespaceSignedFile)
  41. {
  42. std::string tempfile;
  43. FileFd fd;
  44. // no raw-string here to protect the whitespace from cleanup
  45. createTemporaryFile("simplesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE----- \t \n"
  46. "Hash: SHA512 \n"
  47. " \n"
  48. "Test \n"
  49. "-----BEGIN PGP SIGNATURE----- \n"
  50. " \n"
  51. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt \n"
  52. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l \n"
  53. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg \n"
  54. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k \n"
  55. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx \n"
  56. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns \n"
  57. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq \n"
  58. "=TB1F \n"
  59. "-----END PGP SIGNATURE-----");
  60. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  61. EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd));
  62. if (tempfile.empty() == false)
  63. unlink(tempfile.c_str());
  64. EXPECT_TRUE(fd.IsOpen());
  65. char buffer[100];
  66. EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer)));
  67. EXPECT_STREQ(buffer, "Test");
  68. EXPECT_TRUE(fd.Eof());
  69. }
  70. TEST(OpenMaybeClearSignedFileTest,SignedFileWithContentHeaders)
  71. {
  72. std::string tempfile;
  73. FileFd fd;
  74. createTemporaryFile("headerssignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n"
  75. "Version: 0.8.15~exp1\n"
  76. "Hash: SHA512\n"
  77. "Comment: I love you!\n"
  78. "X-Expires: never\n"
  79. "Multilines: no\n"
  80. " yes\n"
  81. " maybe\n"
  82. "\n"
  83. "Test\n"
  84. "-----BEGIN PGP SIGNATURE-----\n"
  85. "\n"
  86. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  87. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  88. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  89. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  90. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  91. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  92. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  93. "=TB1F\n"
  94. "-----END PGP SIGNATURE-----\n");
  95. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  96. EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd));
  97. if (tempfile.empty() == false)
  98. unlink(tempfile.c_str());
  99. EXPECT_TRUE(fd.IsOpen());
  100. char buffer[100];
  101. EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer)));
  102. EXPECT_STREQ(buffer, "Test");
  103. EXPECT_TRUE(fd.Eof());
  104. }
  105. // That isn't how multiple signatures are done
  106. TEST(OpenMaybeClearSignedFileTest,SignedFileWithTwoSignatures)
  107. {
  108. std::string tempfile;
  109. FileFd fd;
  110. createTemporaryFile("doublesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n"
  111. "Hash: SHA512\n"
  112. "\n"
  113. "Test\n"
  114. "-----BEGIN PGP SIGNATURE-----\n"
  115. "\n"
  116. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  117. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  118. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  119. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  120. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  121. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  122. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  123. "=TB1F\n"
  124. "-----END PGP SIGNATURE-----\n"
  125. "-----BEGIN PGP SIGNATURE-----\n"
  126. "\n"
  127. "iQFHBAEBCgAxFiEE3mauypFRr6GHfsMd6FJdR1KBROIFAlhT/yYTHG1hcnZpbkBl\n"
  128. "eGFtcGxlLm9yZwAKCRDoUl1HUoFE4qq3B/459MSk3xCW30wc5+ul5ZxTSg6eLYPJ\n"
  129. "tfVNYi90/ZxRrYQAN+EWozEIZcxoMYp8Ans3++irkjPbHs4NsesmFKt2W5meFl4V\n"
  130. "oUzYrOh5y5GlDeF7ok5g9atQe8BojjBics+g1IBYcnaMU+ywONmlixa03IPGfxV5\n"
  131. "oTx02Xvlns20i6HRc0WFtft5q1hXo4EIlVc9O0u902SVEEkeuHF3+bCcXrNLPBJA\n"
  132. "+8dxmH5+i89f/kVqURrdHdEuA1tsTNyb2C+lvRONh21H8QRRTU/iUQSzV6vZvof5\n"
  133. "ASc9hsAZRG0xHuRU0F94V/XrkWw8QYAobJ/yxvs4L0EuA4optbSqawDB\n"
  134. "=CP8j\n"
  135. "-----END PGP SIGNATURE-----\n");
  136. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  137. EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd));
  138. if (tempfile.empty() == false)
  139. unlink(tempfile.c_str());
  140. EXPECT_TRUE(fd.IsOpen());
  141. char buffer[100];
  142. EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer)));
  143. EXPECT_STREQ(buffer, "Test");
  144. EXPECT_TRUE(fd.Eof());
  145. }
  146. TEST(OpenMaybeClearSignedFileTest,TwoSimpleSignedFile)
  147. {
  148. std::string tempfile;
  149. FileFd fd;
  150. // read only the first message
  151. createTemporaryFile("twosimplesignedfile", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n"
  152. "Hash: SHA512\n"
  153. "\n"
  154. "Test\n"
  155. "-----BEGIN PGP SIGNATURE-----\n"
  156. "\n"
  157. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  158. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  159. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  160. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  161. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  162. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  163. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  164. "=TB1F\n"
  165. "-----END PGP SIGNATURE-----\n"
  166. "-----BEGIN PGP SIGNED MESSAGE-----\n"
  167. "Hash: SHA512\n"
  168. "\n"
  169. "Test\n"
  170. "-----BEGIN PGP SIGNATURE-----\n"
  171. "\n"
  172. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  173. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  174. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  175. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  176. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  177. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  178. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  179. "=TB1F\n"
  180. "-----END PGP SIGNATURE-----");
  181. EXPECT_TRUE(_error->empty());
  182. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  183. EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd));
  184. if (tempfile.empty() == false)
  185. unlink(tempfile.c_str());
  186. EXPECT_FALSE(_error->empty());
  187. EXPECT_FALSE(fd.IsOpen());
  188. // technically they are signed, but we just want one message
  189. EXPECT_TRUE(_error->PendingError());
  190. std::string msg;
  191. EXPECT_TRUE(_error->PopMessage(msg));
  192. EXPECT_EQ("Clearsigned file '" + tempfile + "' contains unsigned lines.", msg);
  193. }
  194. TEST(OpenMaybeClearSignedFileTest,UnsignedFile)
  195. {
  196. std::string tempfile;
  197. FileFd fd;
  198. createTemporaryFile("unsignedfile", fd, &tempfile, "Test");
  199. EXPECT_FALSE(StartsWithGPGClearTextSignature(tempfile));
  200. EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd));
  201. if (tempfile.empty() == false)
  202. unlink(tempfile.c_str());
  203. EXPECT_TRUE(fd.IsOpen());
  204. char buffer[100];
  205. EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer)));
  206. EXPECT_STREQ(buffer, "Test");
  207. EXPECT_TRUE(fd.Eof());
  208. }
  209. TEST(OpenMaybeClearSignedFileTest,GarbageTop)
  210. {
  211. std::string tempfile;
  212. FileFd fd;
  213. createTemporaryFile("garbagetop", fd, &tempfile, "Garbage\n"
  214. "-----BEGIN PGP SIGNED MESSAGE-----\n"
  215. "Hash: SHA512\n"
  216. "\n"
  217. "Test\n"
  218. "-----BEGIN PGP SIGNATURE-----\n"
  219. "\n"
  220. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  221. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  222. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  223. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  224. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  225. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  226. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  227. "=TB1F\n"
  228. "-----END PGP SIGNATURE-----\n");
  229. EXPECT_FALSE(StartsWithGPGClearTextSignature(tempfile));
  230. EXPECT_TRUE(_error->empty());
  231. EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd));
  232. if (tempfile.empty() == false)
  233. unlink(tempfile.c_str());
  234. EXPECT_FALSE(fd.IsOpen());
  235. ASSERT_FALSE(_error->empty());
  236. ASSERT_TRUE(_error->PendingError());
  237. std::string msg;
  238. EXPECT_TRUE(_error->PopMessage(msg));
  239. EXPECT_EQ("Clearsigned file '" + tempfile + "' does not start with a signed message block.", msg);
  240. }
  241. TEST(OpenMaybeClearSignedFileTest,GarbageHeader)
  242. {
  243. std::string tempfile;
  244. FileFd fd;
  245. createTemporaryFile("garbageheader", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE----- Garbage\n"
  246. "Hash: SHA512\n"
  247. "\n"
  248. "Test\n"
  249. "-----BEGIN PGP SIGNATURE-----\n"
  250. "\n"
  251. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  252. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  253. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  254. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  255. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  256. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  257. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  258. "=TB1F\n"
  259. "-----END PGP SIGNATURE-----\n");
  260. EXPECT_FALSE(StartsWithGPGClearTextSignature(tempfile));
  261. // beware: the file will be successfully opened as unsigned file
  262. EXPECT_TRUE(OpenMaybeClearSignedFile(tempfile, fd));
  263. if (tempfile.empty() == false)
  264. unlink(tempfile.c_str());
  265. EXPECT_TRUE(fd.IsOpen());
  266. char buffer[100];
  267. EXPECT_TRUE(fd.ReadLine(buffer, sizeof(buffer)));
  268. EXPECT_STREQ(buffer, "-----BEGIN PGP SIGNED MESSAGE----- Garbage\n");
  269. EXPECT_FALSE(fd.Eof());
  270. }
  271. TEST(OpenMaybeClearSignedFileTest,GarbageBottom)
  272. {
  273. std::string tempfile;
  274. FileFd fd;
  275. createTemporaryFile("garbagebottom", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n"
  276. "Hash: SHA512\n"
  277. "\n"
  278. "Test\n"
  279. "-----BEGIN PGP SIGNATURE-----\n"
  280. "\n"
  281. "iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt\n"
  282. "cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l\n"
  283. "3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg\n"
  284. "X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k\n"
  285. "V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx\n"
  286. "pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns\n"
  287. "JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq\n"
  288. "=TB1F\n"
  289. "-----END PGP SIGNATURE-----\n"
  290. "Garbage");
  291. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  292. EXPECT_TRUE(_error->empty());
  293. EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd));
  294. if (tempfile.empty() == false)
  295. unlink(tempfile.c_str());
  296. EXPECT_FALSE(fd.IsOpen());
  297. ASSERT_FALSE(_error->empty());
  298. ASSERT_TRUE(_error->PendingError());
  299. std::string msg;
  300. EXPECT_TRUE(_error->PopMessage(msg));
  301. EXPECT_EQ("Clearsigned file '" + tempfile + "' contains unsigned lines.", msg);
  302. }
  303. TEST(OpenMaybeClearSignedFileTest,BogusNoSig)
  304. {
  305. std::string tempfile;
  306. FileFd fd;
  307. createTemporaryFile("bogusnosig", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n"
  308. "Hash: SHA512\n"
  309. "\n"
  310. "Test");
  311. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  312. EXPECT_TRUE(_error->empty());
  313. EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd));
  314. if (tempfile.empty() == false)
  315. unlink(tempfile.c_str());
  316. EXPECT_FALSE(_error->empty());
  317. EXPECT_FALSE(fd.IsOpen());
  318. std::string msg;
  319. _error->PopMessage(msg);
  320. EXPECT_EQ("Splitting of clearsigned file " + tempfile + " failed as it doesn't contain all expected parts", msg);
  321. }
  322. TEST(OpenMaybeClearSignedFileTest,BogusSigStart)
  323. {
  324. std::string tempfile;
  325. FileFd fd;
  326. createTemporaryFile("bogusnosig", fd, &tempfile, "-----BEGIN PGP SIGNED MESSAGE-----\n"
  327. "Hash: SHA512\n"
  328. "\n"
  329. "Test\n"
  330. "-----BEGIN PGP SIGNATURE-----");
  331. EXPECT_TRUE(StartsWithGPGClearTextSignature(tempfile));
  332. EXPECT_TRUE(_error->empty());
  333. EXPECT_FALSE(OpenMaybeClearSignedFile(tempfile, fd));
  334. if (tempfile.empty() == false)
  335. unlink(tempfile.c_str());
  336. EXPECT_FALSE(_error->empty());
  337. EXPECT_FALSE(fd.IsOpen());
  338. std::string msg;
  339. _error->PopMessage(msg);
  340. EXPECT_EQ("Signature in file " + tempfile + " wasn't closed", msg);
  341. }