Lines Matching defs:output
104 * \param output
109 pgp_write(pgp_output_t *output, const void *src, unsigned len)
111 return base_write(output, src, len);
118 * \param output
123 pgp_write_scalar(pgp_output_t *output, unsigned n, unsigned len)
129 if (!base_write(output, &c, 1)) {
139 * \param output
144 pgp_write_mpi(pgp_output_t *output, const BIGNUM *bn)
155 return pgp_write_scalar(output, bits, 2) &&
156 pgp_write(output, buf, (bits + 7) / 8);
162 * \param output
167 pgp_write_ptag(pgp_output_t *output, pgp_content_enum tag)
172 return base_write(output, &c, 1);
178 * \param output
183 pgp_write_length(pgp_output_t *output, unsigned len)
189 return base_write(output, c, 1);
194 return base_write(output, c, 2);
196 return pgp_write_scalar(output, 0xff, 1) &&
197 pgp_write_scalar(output, len, 4);
243 * Set a writer in output. There should not be another writer set.
245 * \param output The output structure
252 pgp_writer_set(pgp_output_t *output,
258 if (output->writer.writer) {
261 output->writer.writer = writer;
262 output->writer.finaliser = finaliser;
263 output->writer.destroyer = destroyer;
264 output->writer.arg = arg;
271 * Push a writer in output. There must already be another writer set.
273 * \param output The output structure
280 pgp_writer_push(pgp_output_t *output,
290 } else if (output->writer.writer == NULL) {
293 *copy = output->writer;
294 output->writer.next = copy;
296 output->writer.writer = writer;
297 output->writer.finaliser = finaliser;
298 output->writer.destroyer = destroyer;
299 output->writer.arg = arg;
304 pgp_writer_pop(pgp_output_t *output)
309 if (output->writer.finaliser) {
312 } else if (output->writer.next == NULL) {
316 if (output->writer.destroyer) {
317 output->writer.destroyer(&output->writer);
319 next = output->writer.next;
320 output->writer = *next;
328 * Close the writer currently set in output.
330 * \param output The output structure
333 pgp_writer_close(pgp_output_t *output)
337 ret = pgp_writer_info_finalise(&output->errors, &output->writer);
338 pgp_writer_info_delete(&output->writer);
496 * \param output
500 pgp_writer_push_clearsigned(pgp_output_t *output, pgp_create_sig_t *sig)
510 PGP_ERROR_1(&output->errors, PGP_E_W, "%s", "Bad alloc");
513 ret = (pgp_write(output, header, (unsigned)(sizeof(header) - 1)) &&
514 pgp_write(output, hash, (unsigned)strlen(hash)) &&
515 pgp_write(output, "\r\n\r\n", 4));
518 PGP_ERROR_1(&output->errors, PGP_E_W, "%s",
526 pgp_writer_push(output, dash_esc_writer, NULL,
678 * \param output
681 pgp_writer_use_armored_sig(pgp_output_t *output)
690 pgp_writer_pop(output);
691 if (pgp_write(output, header, (unsigned)(sizeof(header) - 1)) == 0) {
692 PGP_ERROR_1(&output->errors, PGP_E_W, "%s",
697 PGP_ERROR_1(&output->errors, PGP_E_W, "%s",
701 pgp_writer_push(output, linebreak_writer, NULL,
706 PGP_MEMORY_ERROR(&output->errors);
710 pgp_writer_push(output, base64_writer, sig_finaliser,
762 pgp_writer_push_armor_msg(pgp_output_t *output)
768 pgp_write(output, header, (unsigned)(sizeof(header) - 1));
769 pgp_write(output, "\r\n", 2);
775 pgp_writer_push(output, linebreak_writer, NULL,
784 pgp_writer_push(output, base64_writer,
866 pgp_writer_push_armoured(pgp_output_t *output, pgp_armor_type_t type)
906 pgp_write(output, header, hdrsize);
907 pgp_writer_push(output, linebreak_writer, NULL,
916 pgp_writer_push(output, base64_writer, finaliser,
992 pgp_push_enc_crypt(pgp_output_t *output, pgp_crypt_t *pgp_crypt)
1005 pgp_writer_push(output, encrypt_writer, NULL,
1029 pgp_push_enc_se_ip(pgp_output_t *output, const pgp_key_t *pubkey, const char *cipher)
1046 pgp_write_pk_sesskey(output, encrypted_pk_sesskey);
1068 pgp_writer_push(output, encrypt_se_ip_writer, NULL,
1086 pgp_output_t *output;
1094 pgp_setup_memory_write(&output, &localmem, bufsz);
1107 pgp_write_se_ip_pktset(output, pgp_mem_data(zmem),
1138 pgp_write_se_ip_pktset(pgp_output_t *output,
1158 if (!pgp_write_ptag(output, PGP_PTAG_CT_SE_IP_DATA) ||
1159 !pgp_write_length(output, (unsigned)(1 + bufsize)) ||
1160 !pgp_write_scalar(output, PGP_SE_IP_DATA_VERSION, 1)) {
1183 pgp_push_enc_crypt(output, crypted);
1189 if (!pgp_write(output, preamble, (unsigned)preamblesize) ||
1190 !pgp_write(output, data, len) ||
1191 !pgp_write(output, pgp_mem_data(mdc), (unsigned)pgp_mem_len(mdc))) {
1196 pgp_writer_pop(output);
1242 * Set the writer in output to be a stock writer that writes to a file
1246 * \param output The output structure
1252 pgp_writer_set_fd(pgp_output_t *output, int fd)
1260 pgp_writer_set(output, fd_writer, NULL, writer_fd_destroyer, writer);
1284 * \param output The output structure
1291 pgp_writer_set_memory(pgp_output_t *output, pgp_memory_t *mem)
1293 pgp_writer_set(output, memory_writer, NULL, NULL, mem);
1346 \param output
1350 pgp_push_checksum_writer(pgp_output_t *output, pgp_seckey_t *seckey)
1375 pgp_writer_push(output, skey_checksum_writer,
1411 \param output
1415 pgp_push_stream_enc_se_ip(pgp_output_t *output, const pgp_key_t *pubkey, const char *cipher)
1429 pgp_write_pk_sesskey(output, encrypted_pk_sesskey);
1461 pgp_writer_push(output,
1496 write_partial_len(pgp_output_t *output, unsigned len)
1508 return pgp_write(output, &c, 1);
1512 stream_write_litdata(pgp_output_t *output,
1520 write_partial_len(output, (unsigned)pdlen);
1521 pgp_write(output, data, (unsigned)pdlen);
1529 stream_write_litdata_first(pgp_output_t *output,
1548 pgp_write_ptag(output, PGP_PTAG_CT_LITDATA);
1549 write_partial_len(output, (unsigned)sz_pd);
1550 pgp_write_scalar(output, (unsigned)type, 1);
1551 pgp_write_scalar(output, 0, 1);
1552 pgp_write_scalar(output, 0, 4);
1553 pgp_write(output, data, (unsigned)(sz_pd - 6));
1558 return stream_write_litdata(output, data, (unsigned)sz_towrite);
1562 stream_write_litdata_last(pgp_output_t *output,
1566 pgp_write_length(output, len);
1567 return pgp_write(output, data, len);
1571 stream_write_se_ip(pgp_output_t *output,
1580 write_partial_len(output, (unsigned)pdlen);
1582 pgp_push_enc_crypt(output, se_ip->crypt);
1583 pgp_write(output, data, (unsigned)pdlen);
1584 pgp_writer_pop(output);
1595 stream_write_se_ip_first(pgp_output_t *output,
1621 pgp_write_ptag(output, PGP_PTAG_CT_SE_IP_DATA);
1622 write_partial_len(output, (unsigned)sz_pd);
1623 pgp_write_scalar(output, PGP_SE_IP_DATA_VERSION, 1);
1624 pgp_push_enc_crypt(output, se_ip->crypt);
1636 pgp_write(output, preamble, (unsigned)preamblesize);
1638 pgp_write(output, data, (unsigned)(sz_pd - preamblesize - 1));
1642 pgp_writer_pop(output);
1643 stream_write_se_ip(output, data, (unsigned)sz_towrite, se_ip);
1649 stream_write_se_ip_last(pgp_output_t *output,
1678 pgp_write_length(output, (unsigned)bufsize);
1681 pgp_push_enc_crypt(output, se_ip->crypt);
1683 pgp_write(output, data, len);
1684 pgp_write(output, pgp_mem_data(mdcmem), (unsigned)pgp_mem_len(mdcmem));
1686 pgp_writer_pop(output);