fixed dead assignment

This commit is contained in:
Frank Morgner 2019-01-25 22:00:10 +01:00
parent e4a01643a6
commit 32e1995300
4 changed files with 9 additions and 5 deletions

View File

@ -840,7 +840,7 @@ iasecc_update_blob(struct sc_context *ctx, struct iasecc_extended_tlv *tlv,
unsigned char **blob, size_t *blob_size)
{
unsigned char *pp = NULL;
int offs = 0, sz = tlv->size + 2;
int offs = 0, sz;
if (tlv->size == 0)
LOG_FUNC_RETURN(ctx, SC_SUCCESS);

View File

@ -1563,7 +1563,6 @@ awp_update_df_create_data(struct sc_pkcs15_card *p15card, struct sc_profile *pro
struct sc_context *ctx = p15card->card->ctx;
struct sc_file *info_file=NULL, *obj_file=NULL;
struct awp_data_info idata;
struct sc_pkcs15_der der;
struct sc_path path;
unsigned obj_id, obj_type = obj->auth_id.len ? COSM_TYPE_PRIVDATA_OBJECT : SC_PKCS15_TYPE_DATA_OBJECT;
int rv;
@ -1571,7 +1570,6 @@ awp_update_df_create_data(struct sc_pkcs15_card *p15card, struct sc_profile *pro
LOG_FUNC_CALLED(ctx);
memset(&idata, 0, sizeof(idata));
der = obj->content;
path = ((struct sc_pkcs15_data_info *)obj->data)->path;
obj_id = (path.value[path.len-1] & 0xFF) + (path.value[path.len-2] & 0xFF) * 0x100;

View File

@ -302,8 +302,6 @@ static int parse_private_key(const u8 *key, size_t keysize, RSA *rsa)
if (dmq1 == NULL)
return -1;
cf2bn(p, base, dmq1);
p += base;
if (RSA_set0_factors(rsa, bn_p, q) != 1)
return -1;
@ -784,6 +782,10 @@ static int encode_public_key(RSA *rsa, u8 *key, size_t *keysize)
memcpy(p, bnbuf, 2*base);
p += 2*base;
r = bn2cf(rsa_e, bnbuf);
if (r != 4) {
fprintf(stderr, "Invalid exponent value.\n");
return 2;
}
memcpy(p, bnbuf, 4);
p += 4;

View File

@ -383,6 +383,10 @@ static int gen_key(const char * key_info)
x = BN_bin2bn(keydata.ecpoint + 1, i, NULL);
y = BN_bin2bn(keydata.ecpoint + 1 + i, i, NULL) ;
r = EC_POINT_set_affine_coordinates_GFp(ecgroup, ecpoint, x, y, NULL);
if (r == 0) {
fprintf(stderr, "EC_POINT_set_affine_coordinates_GFp failed\n");
return -1;
}
eckey = EC_KEY_new();
r = EC_KEY_set_group(eckey, ecgroup);
if (r == 0) {