the buffer pointer.
Rename PKCS7_PARTSIGN to PKCS7_STREAM.
Guess what that's for :-)
cleartext signing (multipart/signed type) is effectively streaming
and the signed data does not need to be all held in memory.
- This is done with a new flag PKCS7_PARTSIGN. When this flag is set
+ This is done with a new flag PKCS7_STREAM. When this flag is set
PKCS7_sign() only initializes the PKCS7 structure and the actual signing
is done after the data is output (and digests calculated) in
SMIME_write_PKCS7().
* signing.
*/
if ((flags & PKCS7_DETACHED) && (outformat == FORMAT_SMIME))
- flags |= PKCS7_PARTSIGN;
+ flags |= PKCS7_STREAM;
p7 = PKCS7_sign(signer, key, other, in, flags);
/* Don't need to rewind for partial signing */
- if (!(flags & PKCS7_PARTSIGN) && (BIO_reset(in) != 0)) {
+ if (!(flags & PKCS7_STREAM) && (BIO_reset(in) != 0)) {
BIO_printf(bio_err, "Can't rewind input file\n");
goto end;
}
if(out) {
if(usetag) ASN1_put_object(out, ndef, len, tag, aclass);
asn1_ex_i2c(pval, *out, &utype, it);
- *out += len;
+ if (ndef)
+ ASN1_put_eoc(out);
+ else
+ *out += len;
}
if(usetag) return ASN1_object_size(ndef, len, tag);
{
strtmp->data = cout;
strtmp->length = 0;
- ASN1_put_eoc(&cout);
}
/* Special return code */
return -2;
{
BIO *tmpbio, *p7bio;
- if (!(flags & PKCS7_PARTSIGN))
+ if (!(flags & PKCS7_STREAM))
{
SMIME_crlf_copy(data, out, flags);
return 1;
}
}
- if (flags & PKCS7_PARTSIGN)
+ if (flags & PKCS7_STREAM)
return p7;
if (!(p7bio = PKCS7_dataInit(p7, NULL))) {
#define PKCS7_BINARY 0x80
#define PKCS7_NOATTR 0x100
#define PKCS7_NOSMIMECAP 0x200
-#define PKCS7_PARTSIGN 0x400
+#define PKCS7_STREAM 0x400
/* Flags: for compatibility with older code */