mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-15 16:49:20 -05:00
added the ability to produce raw signatures, without signer id nor time stamp
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6273 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ae49bbc1ac
commit
404e9362dc
4 changed files with 15 additions and 8 deletions
|
|
@ -1324,7 +1324,9 @@ ops_memory_t* ops_sign_buf(const void* input, const size_t input_len,
|
|||
const ops_sig_type_t sig_type,
|
||||
const ops_secret_key_t *skey,
|
||||
const ops_boolean_t use_armour,
|
||||
ops_boolean_t include_data)
|
||||
ops_boolean_t include_data,
|
||||
ops_boolean_t include_creation_time,
|
||||
ops_boolean_t include_key_id)
|
||||
{
|
||||
// \todo allow choice of hash algorithams
|
||||
// enforce use of SHA1 for now
|
||||
|
|
@ -1382,10 +1384,14 @@ ops_memory_t* ops_sign_buf(const void* input, const size_t input_len,
|
|||
// - creation time
|
||||
// - key id
|
||||
|
||||
ops_signature_add_creation_time(sig, time(NULL));
|
||||
if(include_creation_time)
|
||||
ops_signature_add_creation_time(sig, time(NULL));
|
||||
|
||||
ops_keyid(keyid, &skey->public_key);
|
||||
ops_signature_add_issuer_key_id(sig, keyid);
|
||||
if(include_key_id)
|
||||
{
|
||||
ops_keyid(keyid, &skey->public_key);
|
||||
ops_signature_add_issuer_key_id(sig, keyid);
|
||||
}
|
||||
|
||||
ops_signature_hashed_subpackets_end(sig);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ void ops_signature_add_primary_user_id(ops_create_signature_t *sig,
|
|||
ops_boolean_t ops_sign_file_as_cleartext(const char* input_filename, const char* output_filename, const ops_secret_key_t *skey, const ops_boolean_t overwrite);
|
||||
ops_boolean_t ops_sign_buf_as_cleartext(const char* input, const size_t len, ops_memory_t** output, const ops_secret_key_t *skey);
|
||||
ops_boolean_t ops_sign_file(const char* input_filename, const char* output_filename, const ops_secret_key_t *skey, const ops_boolean_t use_armour, const ops_boolean_t overwrite);
|
||||
ops_memory_t * ops_sign_buf(const void* input, const size_t input_len, const ops_sig_type_t sig_type, const ops_secret_key_t *skey, const ops_boolean_t use_armour,ops_boolean_t include_data);
|
||||
ops_memory_t * ops_sign_buf(const void* input, const size_t input_len, const ops_sig_type_t sig_type, const ops_secret_key_t *skey, const ops_boolean_t use_armour,ops_boolean_t include_data,ops_boolean_t include_creation_time,ops_boolean_t include_key_id);
|
||||
ops_boolean_t ops_writer_push_signed(ops_create_info_t *cinfo, const ops_sig_type_t sig_type, const ops_secret_key_t *skey);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue