catch and debug more errors

This commit is contained in:
Frank Morgner
2013-10-21 18:26:04 +02:00
parent f6879f42de
commit a11be64015
3 changed files with 32 additions and 5 deletions

View File

@@ -407,6 +407,8 @@ static int format_mse_cdata(struct sc_context *ctx, int protocol,
data = NPA_MSE_C_new();
if (!data) {
ssl_error(ctx);
r = SC_ERROR_INTERNAL;
goto err;
}
@@ -455,6 +457,7 @@ static int format_mse_cdata(struct sc_context *ctx, int protocol,
if (auxiliary_data && auxiliary_data_len) {
if (!d2i_ASN1_AUXILIARY_DATA(&data->auxiliary_data, &auxiliary_data, auxiliary_data_len)) {
sc_debug(ctx, SC_LOG_DEBUG_VERBOSE, "Error setting authenticated auxiliary data of MSE:Set AT data");
ssl_error(ctx);
r = SC_ERROR_INTERNAL;
goto err;
}
@@ -468,6 +471,7 @@ static int format_mse_cdata(struct sc_context *ctx, int protocol,
if (length < 0
|| (0x80 & ASN1_get_object(&data_no_sequence, &length, &tag, &class, length))) {
sc_debug(ctx, SC_LOG_DEBUG_VERBOSE, "Error encoding MSE:Set AT APDU data");
ssl_error(ctx);
r = SC_ERROR_INTERNAL;
goto err;
}