removed a few asserts

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5234 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-06-19 18:58:07 +00:00
parent b603ef9d9f
commit d825508836

View File

@ -311,7 +311,7 @@ static ops_boolean_t rsa_verify(ops_hash_algorithm_t type,
default: default:
fprintf(stderr,"Warning: unhandled hash type in signature verification code: %d\n",type) ; fprintf(stderr,"Warning: unhandled hash type in signature verification code: %d\n",type) ;
assert(0); break; return ops_false ;
} }
if(keysize-plen-hash_length < 10) if(keysize-plen-hash_length < 10)
@ -415,7 +415,7 @@ static void hash_add_trailer(ops_hash_t *hash, const ops_signature_t *sig,
ops_boolean_t ops_check_signature(const unsigned char *hash, unsigned length, ops_boolean_t ops_check_signature(const unsigned char *hash, unsigned length,
const ops_signature_t *sig, const ops_signature_t *sig,
const ops_public_key_t *signer) const ops_public_key_t *signer)
{ {
ops_boolean_t ret; ops_boolean_t ret;
/* /*
@ -429,7 +429,7 @@ ops_boolean_t ops_check_signature(const unsigned char *hash, unsigned length,
case OPS_PKA_DSA: case OPS_PKA_DSA:
ret=ops_dsa_verify(hash, length, &sig->info.signature.dsa, ret=ops_dsa_verify(hash, length, &sig->info.signature.dsa,
&signer->key.dsa); &signer->key.dsa);
/* fprintf(stderr,"Cannot verify DSA signature. skipping.\n") ; /* fprintf(stderr,"Cannot verify DSA signature. skipping.\n") ;
ret = ops_false ; */ ret = ops_false ; */
break; break;
@ -439,11 +439,13 @@ ops_boolean_t ops_check_signature(const unsigned char *hash, unsigned length,
break; break;
default: default:
assert(0); fprintf(stderr,"Cannot verify signature. Unknown key signing algorithm %d. skipping.\n",sig->info.key_algorithm) ;
ret = ops_false ;
} }
return ret; return ret;
} }
static ops_boolean_t hash_and_check_signature(ops_hash_t *hash, static ops_boolean_t hash_and_check_signature(ops_hash_t *hash,
const ops_signature_t *sig, const ops_signature_t *sig,
@ -770,7 +772,7 @@ ops_boolean_t ops_write_signature(ops_create_signature_t *sig,
const ops_public_key_t *key, const ops_public_key_t *key,
const ops_secret_key_t *skey, const ops_secret_key_t *skey,
ops_create_info_t *info) ops_create_info_t *info)
{ {
ops_boolean_t rtn=ops_false; ops_boolean_t rtn=ops_false;
size_t l=ops_memory_get_length(sig->mem); size_t l=ops_memory_get_length(sig->mem);
@ -850,7 +852,7 @@ ops_boolean_t ops_write_signature(ops_create_signature_t *sig,
if (!rtn) if (!rtn)
OPS_ERROR(&info->errors, OPS_E_W, "Cannot write signature"); OPS_ERROR(&info->errors, OPS_E_W, "Cannot write signature");
return rtn; return rtn;
} }
/** /**
* \ingroup Core_Signature * \ingroup Core_Signature