summaryrefslogtreecommitdiffstats
path: root/crypto/rsa
AgeCommit message (Collapse)Author
2005-05-11Fix more error codes.Bodo Möller
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
2005-04-26Port BN_MONT_CTX_set_locked() from stable branch.Dr. Stephen Henson
The function rsa_eay_mont_helper() has been removed because it is no longer needed after this change.
2005-04-26some updates for the blinding code; summary:Nils Larsch
- possibility of re-creation of the blinding parameters after a fixed number of uses (suggested by Bodo) - calculatition of the rsa::e in case it's absent and p and q are present (see bug report #785) - improve the performance when if one rsa structure is shared by more than a thread (see bug report #555) - fix the problem described in bug report #827 - hide the definition ot the BN_BLINDING structure in bn_blind.c
2005-04-26Port from stable branch.Dr. Stephen Henson
2005-04-22- use BN_set_negative and BN_is_negative instead of BN_set_signNils Larsch
and BN_get_sign - implement BN_set_negative as a function - always use "#define BN_is_zero(a) ((a)->top == 0)"
2005-04-12Rebuild error codes.Dr. Stephen Henson
2005-04-11Add emacs cache files to .cvsignore.Richard Levitte
2005-03-31Give everything prototypes (well, everything that's actually used).Ben Laurie
2005-03-30Blow away Makefile.ssl.Ben Laurie
2004-12-05Add lots of checks for memory allocation failure, error codes to indicateDr. Stephen Henson
failure and freeing up memory if a failure occurs. PR:620
2004-11-02Don't use $(EXHEADER) directly in for loops, as most shells will breakRichard Levitte
if $(EXHEADER) is empty. Notified by many, solution suggested by Carson Gaspar <carson@taltos.org>
2004-09-19Remove distracting comments and code. Thanks to Nils for picking up on theGeoff Thorpe
outstanding ticket. PR: 926
2004-05-17After the latest round of header-hacking, regenerate the dependencies inGeoff Thorpe
the Makefiles. NB: this commit is probably going to generate a huge posting and it is highly uninteresting to read.
2004-05-17Deprecate the recursive includes of bn.h from various API headers (asn1.h,Geoff Thorpe
dh.h, dsa.h, ec.h, ecdh.h, ecdsa.h, rsa.h), as the opaque bignum types are already declared in ossl_typ.h. Add explicit includes for bn.h in those C files that need access to structure internals or API functions+macros.
2004-04-27With the new dynamic BN_CTX implementation, there should be no need forGeoff Thorpe
additional contexts.
2004-04-26The problem of rsa key-generation getting stuck in a loop for (pointlessly)Geoff Thorpe
small key sizes seems to result from the code continually regenerating the same prime value once the range is small enough. From my tests, this change fixes the problem by setting an escape velocity of 3 repeats for the second of the two primes. PR: 874
2004-04-26Allow RSA key-generation to specify an arbitrary public exponent. JelteGeoff Thorpe
proposed the change and submitted the patch, I jiggled it slightly and adjusted the other parts of openssl that were affected. PR: 867 Submitted by: Jelte Jansen Reviewed by: Geoff Thorpe
2004-04-19make updateGeoff Thorpe
2004-04-19Reduce header interdependencies, initially in engine.h (the rest of theGeoff Thorpe
changes are the fallout). As this could break source code that doesn't directly include headers for interfaces it uses, changes to recursive includes are covered by the OPENSSL_NO_DEPRECATED symbol. It's better to define this when building and using openssl, and then adapt code where necessary - this is how to stay current. However the mechanism exists for the lethargic.
2004-03-25By adding a BN_CTX parameter to the 'rsa_mod_exp' callback, private keyGeoff Thorpe
operations no longer require two distinct BN_CTX structures. This may put more "strain" on the current BN_CTX implementation (which has a fixed limit to the number of variables it will hold), but so far this limit is not triggered by any of the tests pass and I will be changing BN_CTX in the near future to avoid this problem anyway. This also changes the default RSA implementation code to use the BN_CTX in favour of initialising some of its variables locally in each function.
2004-03-15Constify d2i, s2i, c2i and r2i functions and other associatedRichard Levitte
functions and macros. This change has associated tags: LEVITTE_before_const and LEVITTE_after_const. Those will be removed when this change has been properly reviewed.
2004-03-15Make sure that the last argument to RAND_add() is a float, or someRichard Levitte
compilers may complain.
2003-12-27Use sh explicitely to run point.shRichard Levitte
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-11-28Netware-specific changes,Richard Levitte
PR: 780 Submitted by: Verdon Walker <VWalker@novell.com> Reviewed by: Richard Levitte
2003-10-29A general spring-cleaning (in autumn) to fix up signed/unsigned warnings.Geoff Thorpe
I have tried to convert 'len' type variable declarations to unsigned as a means to address these warnings when appropriate, but when in doubt I have used casts in the comparisons instead. The better solution (that would get us all lynched by API users) would be to go through and convert all the function prototypes and structure definitions to use unsigned variables except when signed is necessary. The proliferation of (signed) "int" for strictly non-negative uses is unfortunate.
2003-10-29When OPENSSL_NO_DEPRECATED is defined, deprecated functions are (or shouldGeoff Thorpe
be) precompiled out in the API headers. This change is to ensure that if it is defined when compiling openssl, the deprecated functions aren't implemented either.
2003-05-07DO NOT constify RSA* in RSA_sign() and RSA_verify(), since there are functionRichard Levitte
called downstream that need it to be non-const. The fact that the RSA_METHOD functions take the RSA* as a const doesn't matter, it just expresses that *they* won't touch it. PR: 602
2003-05-05Constify RSA_sign() and RSA_verify().Richard Levitte
PR: 602
2003-05-01make updateRichard Levitte
2003-04-16Memory leak fix: RSA_blinding_on() didn't free Ai under certain circumstances.Richard Levitte
Memory leak fix: RSA_blinding_on() would leave a dangling pointer in rsa->blinding under certain circumstances. Double definition fix: RSA_FLAG_NO_BLINDING was defined twice.
2003-04-15Memory leak fix: local blinding structure not freed in rsa_eay_private_decrypt()Richard Levitte
2003-04-10make updateRichard Levitte
2003-04-08Include rand.h, so RAND_status() and friends get properly declared.Richard Levitte
2003-04-08We seem to carry some rests of the 0.9.6 [engine] ENGINE framework, here inRichard Levitte
form of unneeded direct calls through the engine pointer..
2003-04-08We seem to carry some rests of the 0.9.6 [engine] ENGINE framework in formRichard Levitte
of unneeded includes of openssl/engine.h.
2003-04-07RSA_FLAG_SIGN_VER indicates the special rsa_sign and rsa_verify functionRichard Levitte
pointers should be used. It doesn't necessarely mean it should go through the ENGINE framework.
2003-04-02make RSA blinding thread-safeBodo Möller
2003-03-20make sure RSA blinding works when the PRNG is not properly seeded;Bodo Möller
enable it automatically for the built-in engine
2003-02-15We cache a montgomery form for 'n' if the PUBLIC flag is set, not PRIVATE.Geoff Thorpe
Also, I've added handling for other mod_exp calls that were not using any cached montgomery forms. These cases matter only for special RSA keys (eg. ones that are missing information) so are unlikely to be used in normal circumstances.
2003-02-14David Brumley <dbrumley@stanford.edu> noted and corrected a case in theGeoff Thorpe
verification step of CRT private key operations in the RSA code - previously no montgomery form was checked or used for 'n', and so it would be generated on the fly each time. As a result, private key operations are now a percent or two faster. Rather than adding this as another repetition of the nearly-identical montgomery "check for first-use" initialisation code blocks, I've taken this chance to create a helper function and macro-wrapper to replace them. PR: 475
2003-01-30The OPENSSL_NO_ENGINE has small problem: it changes certain structures. That'sRichard Levitte
bad, so let's not check OPENSSL_NO_ENGINE in those places. Fortunately, all the header files where the problem existed include ossl_typ.h, which makes a 'forward declaration' of the ENGINE type.
2003-01-30Add the possibility to build without the ENGINE framework.Richard Levitte
PR: 287
2003-01-07This is the first step in allowing RSA_METHODs to implement their own keyGeoff Thorpe
generation. This prototype matches the new API function RSA_generate_key_ex(), though both may be subject to change during development before 0.9.8.
2002-12-29make updateRichard Levitte
2002-12-09make updateRichard Levitte
2002-12-08Nils Larsch submitted;Geoff Thorpe
- a patch to fix a memory leak in rsa_gen.c - a note about compiler warnings with unions - a note about improving structure element names This applies his patch and implements a solution to the notes.
2002-12-08This is a first-cut at improving the callback mechanisms used inGeoff Thorpe
key-generation and prime-checking functions. Rather than explicitly passing callback functions and caller-defined context data for the callbacks, a new structure BN_GENCB is defined that encapsulates this; a pointer to the structure is passed to all such functions instead. This wrapper structure allows the encapsulation of "old" and "new" style callbacks - "new" callbacks return a boolean result on the understanding that returning FALSE should terminate keygen/primality processing. The BN_GENCB abstraction will allow future callback modifications without needing to break binary compatibility nor change the API function prototypes. The new API functions have been given names ending in "_ex" and the old functions are implemented as wrappers to the new ones. The OPENSSL_NO_DEPRECATED symbol has been introduced so that, if defined, declaration of the older functions will be skipped. NB: Some openssl-internal code will stick with the older callbacks for now, so appropriate "#undef" logic will be put in place - this is in case the user is *building* openssl (rather than *including* its headers) with this symbol defined. There is another change in the new _ex functions; the key-generation functions do not return key structures but operate on structures passed by the caller, the return value is a boolean. This will allow for a smoother transition to having key-generation as "virtual function" in the various ***_METHOD tables.
2002-11-28Cleanse memory using the new OPENSSL_cleanse() function.Richard Levitte
I've covered all the memset()s I felt safe modifying, but may have missed some.
2002-11-26The logic in the main signing and verifying functions to check lengths wasRichard Levitte
incorrect. Fortunately, there is a second check that's correct, when adding the pads. PR: 355
2002-11-04implement and use new macros BN_get_sign(), BN_set_sign()Bodo Möller
Submitted by: Nils Larsch