Merge lp:~scolphoy/hipl/RSA_generate_key_ex into lp:hipl

Proposed by Pupu Toivonen
Status: Superseded
Proposed branch: lp:~scolphoy/hipl/RSA_generate_key_ex
Merge into: lp:hipl
Diff against target: 29 lines (+6/-5)
1 file modified
libcore/crypto.c (+6/-5)
To merge this branch: bzr merge lp:~scolphoy/hipl/RSA_generate_key_ex
Reviewer Review Type Date Requested Status
Miika Komu Needs Fixing
Review via email: mp+186684@code.launchpad.net

This proposal has been superseded by a proposal from 2013-09-20.

Description of the change

Change RSA_generate_key to RSA_generate_key_ex in crypto.c

The RSA_generate_key function has been deprecated in OpenSSL
in favour of the newer function RSA_generate_key_ex.
http://www.openssl.org/docs/crypto/RSA_generate_key.html

RSA_generate_key_ex with its current interface has been
part of OpenSSL starting from version 0.9.8 (July 2005).
Granted it still remains a bit poorly documented.

If OpenSSL was compiled with the 'no-deprecated' argument,
the old function will not be available. This is the case
e.g. with modern versions of Android.

I tried compiling the revision from trunk added with
these changes and connecting to a hip-enabled host;
I found no difference in operation compared to using
the older function.

To post a comment you must log in.
Revision history for this message
Miika Komu (miika-iki) wrote :

Use the hooks (or set the copyright year manually). Please fix and then merge.

review: Needs Fixing
6433. By Pupu Toivonen

Update year in copyright tag

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libcore/crypto.c'
2--- libcore/crypto.c 2012-05-12 06:54:33 +0000
3+++ libcore/crypto.c 2013-09-20 06:30:15 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (c) 2010-2012 Aalto University and RWTH Aachen University.
7+ * Copyright (c) 2010-2013 Aalto University and RWTH Aachen University.
8 *
9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11@@ -766,13 +766,14 @@
12 */
13 RSA *create_rsa_key(const int bits)
14 {
15- RSA *rsa = NULL;
16+ RSA *rsa = RSA_new();
17+ BIGNUM *f4 = BN_new();
18+ BN_set_word(f4, RSA_F4);
19
20 /* generate private and public keys */
21 HIP_DEBUG("*****************Creating RSA of %d bits\n\n\n", bits);
22- rsa = RSA_generate_key(bits, RSA_F4, NULL, NULL);
23- if (!rsa) {
24- HIP_ERROR("create_rsa_key failed (RSA_generate_key): %s\n",
25+ if (!RSA_generate_key_ex(rsa, bits, f4, NULL)) {
26+ HIP_ERROR("create_rsa_key failed (RSA_generate_key_ex): %s\n",
27 ERR_error_string(ERR_get_error(), NULL));
28 goto err_out;
29 }

Subscribers

People subscribed via source and target branches

to all changes: