fix typo on *paramp test.
check alg_info always, not only in some case. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2720 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
252fa4b868
commit
e49f78a360
|
@ -103,7 +103,7 @@ asn1_decode_pbkdf2_params(sc_context_t *ctx, void **paramp,
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
*paramp = malloc(sizeof(info));
|
*paramp = malloc(sizeof(info));
|
||||||
if (*paramp)
|
if (!*paramp)
|
||||||
return SC_ERROR_OUT_OF_MEMORY;
|
return SC_ERROR_OUT_OF_MEMORY;
|
||||||
memcpy(*paramp, &info, sizeof(info));
|
memcpy(*paramp, &info, sizeof(info));
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -335,14 +335,14 @@ sc_asn1_encode_algorithm_id(sc_context_t *ctx,
|
||||||
u8 *tmp;
|
u8 *tmp;
|
||||||
|
|
||||||
alg_info = sc_asn1_get_algorithm_info(id);
|
alg_info = sc_asn1_get_algorithm_info(id);
|
||||||
|
|
||||||
/* Set the oid if not yet given */
|
|
||||||
if (id->obj_id.value[0] <= 0) {
|
|
||||||
if (alg_info == NULL) {
|
if (alg_info == NULL) {
|
||||||
sc_error(ctx, "Cannot encode unknown algorithm %u.\n",
|
sc_error(ctx, "Cannot encode unknown algorithm %u.\n",
|
||||||
id->algorithm);
|
id->algorithm);
|
||||||
return SC_ERROR_INVALID_ARGUMENTS;
|
return SC_ERROR_INVALID_ARGUMENTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set the oid if not yet given */
|
||||||
|
if (id->obj_id.value[0] <= 0) {
|
||||||
temp_id = *id;
|
temp_id = *id;
|
||||||
temp_id.obj_id = alg_info->oid;
|
temp_id.obj_id = alg_info->oid;
|
||||||
id = &temp_id;
|
id = &temp_id;
|
||||||
|
|
Loading…
Reference in New Issue