File: insertgpgsection.cc

package info (click to toggle)
guncat 0.92.00-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 224 kB
  • ctags: 58
  • sloc: cpp: 387; makefile: 139
file content (23 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "decryptor.ih"

int Decryptor::insertPGPsection(Process &gpg, string const &pgpHeader, 
                                istream &in)
{
    gpg.start();

    gpg << pgpHeader << '\n';
    string line;
    do
    {
        getline(in, line);
        gpg << line << '\n';
    }
    while (line.find("-----END PGP MESSAGE-----") != 0);

    gpg.close();
    int ret = gpg.waitForChild();

    (d_msgName == "-" ? cerr : d_msg)  << gpg.childErrStream().rdbuf();

    return ret;
}