summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/reds.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/reds.c b/server/reds.c
index b63699ce..0390602b 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1368,8 +1368,15 @@ static int reds_send_link_ack(RedLinkInfo *link)
return FALSE;
}
- RSA_generate_key_ex(link->tiTicketing.rsa, SPICE_TICKET_KEY_PAIR_LENGTH, link->tiTicketing.bn,
- NULL);
+ if (RSA_generate_key_ex(link->tiTicketing.rsa,
+ SPICE_TICKET_KEY_PAIR_LENGTH,
+ link->tiTicketing.bn,
+ NULL) != 1) {
+ spice_warning("Failed to generate %d bits RSA key: %s",
+ SPICE_TICKET_KEY_PAIR_LENGTH,
+ ERR_error_string(ERR_get_error(), NULL));
+ goto end;
+ }
link->tiTicketing.rsa_size = RSA_size(link->tiTicketing.rsa);
i2d_RSA_PUBKEY_bio(bio, link->tiTicketing.rsa);