charon.rsa_pss = no
Whether to use RSA with PSS padding instead of PKCS#1 padding by default.
+charon.rsa_pss_trailerfield = no
+ Whether to encode an explicit trailerField value of 0x01 in the RSA-PSS
+ algorithmIdentifier (CONTEXT3) or using the DEFAULT value by omitting it.
+
charon.send_delay = 0
Delay in ms for sending packets, to simulate larger RTT.
bool rsa_pss_params_build(rsa_pss_params_t *params, chunk_t *asn1)
{
chunk_t hash = chunk_empty, mgf = chunk_empty, slen = chunk_empty;
+ chunk_t trfd = chunk_empty;
int alg;
if (params->hash != HASH_SHA1)
return FALSE;
}
hash = asn1_algorithmIdentifier(alg);
+
+ /* set explicit trailerField with default value of 0x01 */
+ if (lib->settings->get_bool(lib->settings, "%s.rsa_pss_trailerfield",
+ FALSE, lib->ns))
+ {
+ trfd = asn1_integer("m", asn1_integer_from_uint64(0x01));
+ }
}
if (params->mgf1_hash != HASH_SHA1)
{ /* with MGF1-SHA1 we MUST omit the field */
{
slen = asn1_integer("m", asn1_integer_from_uint64(params->salt_len));
}
- *asn1 = asn1_wrap(ASN1_SEQUENCE, "mmm",
+ *asn1 = asn1_wrap(ASN1_SEQUENCE, "mmmm",
hash.len ? asn1_wrap(ASN1_CONTEXT_C_0, "m", hash) : chunk_empty,
- mgf.len ? asn1_wrap(ASN1_CONTEXT_C_1, "m", mgf) : chunk_empty,
- slen.len ? asn1_wrap(ASN1_CONTEXT_C_2, "m", slen) : chunk_empty);
+ mgf.len ? asn1_wrap(ASN1_CONTEXT_C_1, "m", mgf) : chunk_empty,
+ slen.len ? asn1_wrap(ASN1_CONTEXT_C_2, "m", slen) : chunk_empty,
+ trfd.len ? asn1_wrap(ASN1_CONTEXT_C_3, "m", trfd) : chunk_empty);
return TRUE;
}