| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Remove unnecessary parentheses and use a better place to break an overlong
line.
|
|
|
|
|
|
|
| |
Use an error exit that frees the ui in case the UI_add_* fail. Also add
a few empty lines for readability.
ok joshua
|
|
|
|
|
|
|
|
|
|
| |
This removes the global pkey_app_methods stack that was never cleaned up
and makes EVP_PKEY_meth_add0() always fail and push an error on the stack.
EVP_PKEY_meth_find() can now walk the list of PKEY_METHODs forward and
things become a bit cleaner. It's still all way more complicated than it
needs to be...
ok jsing
|
|
|
|
|
|
|
|
|
| |
In order to determine whether GOST is properly enabled, libssl has various
weird dances. In this specific case, it calls EVP_PKEY_meth_find() to see
whether the relevant cipher is around. Check the same thing with an #ifdef
instead.
ok jsing
|
|
|
|
|
|
|
|
| |
The EVP_CIPHER structs are static const data that the library returns when
you call EVP_aes_128_cbc(), for example. It makes no sense whatsoever to
hang user data off such a struct, but it's been there since forever.
ok jsing
|
|
|
|
|
| |
Use better variable names without silly p prefix and use explicit checks
against NULL.
|
|
|
|
|
|
|
|
|
| |
Use slightly better argument and variable names, do not pointlessly try
to match a string of negative length < -1, use a size_t for the strlen()
and preserve the logic that allows lookup by a string fragment rather
than a full string.
ok jsing
|
|
|
|
|
|
|
|
|
| |
EVP_PKEY_asn1_find() finds the EVP_PKEY_ASN1_METHOD underlying the method
or alias with nid (or, rather, pkey_id) passed in. Now that we have the
base method stored in a pointer, we can return that method after a simple
lookup of said nid (or, rather, pkey_id).
ok jsing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every EVP_PKEY_ASN1_METHOD is either an ASN.1 method or an alias.
As such it resolves to an underlying ASN.1 method (in one step).
This information can be stored in a base_method pointer in allusion
to the pkey_base_id, which is the name for the nid (aka pkey_id aka
type) of the underlying method.
For an ASN.1 method, the base method is itself, so the base method
is set as a pointer to itself. For an alias it is of course a pointer
to the underlying method. Then obviously ameth->pkey_base_id is the
same as ameth->base_method->pkey_id, so rework all ASN.1 methods to
follow that.
ok jsing
|
|
|
|
|
|
|
|
|
|
|
| |
The few pieces of the ameth lib that will stay in libcrypto were moved to
p_lib.c recently. The functions that still are in ameth_lib.c will be
removed in the next major bump. With disabled EVP_PKEY_asn1_add{0,_alias}()
API they are completely useless now and they are getting in the way of more
ameth surgery. Rip out their guts and turn them into stubs that do nothing
but push an error onto the stack.
ok jsing
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason DSA, GOST, and RSA had their ASN.1 methods stored in
an array. This is clumsy and the only benefit is that one saves a few
externs in p_lib.c. They were also arranged by ascending NID because
of bsearch() madness.
Split them up and arrange the methods by name, which is much saner
and simpler.
ok jsing
|
|
|
|
|
|
|
|
|
|
| |
There are two unsigned char arrays of size EVP_MAX_IV_LENGTH to store the
IVs of block ciphers. In most modes, only iv is used, but in some modes iv
is modified and oiv is used to store the original IV. At the moment nothing
enforces that they are of the same length. Therefore make sure the correct
one or both are checked before writing to or reading from them.
ok miod
|
|
|
|
|
|
|
| |
First came EVP_CIPHER_param_to_asn1() which wraps EVP_CIPHER_set_asn1_iv()
which was implemented last. Then came EVP_CIPHER_asn1_to_param() wrapping
EVP_CIPHER_get_asn1_iv(). Move each param function below the iv function
it wraps.
|
| |
|
|
|
|
|
|
| |
This isn't great since the struct is ordered in about the silliest way
imaginable, but it is better than it was before. Bringing order into
this mess is harder than solving a Rubik's cube.
|
|
|
|
|
| |
These confusingly named getters were added "for convenience" in 1.1.
They fit best next to the EVP_CIPHER API.
|
|
|
|
|
| |
They are now below the CMS ASN.1 IV stuff, but above the EVP_CIPHER_meth*
API, which are setters, in a way.
|
|
|
|
| |
There's no need for a ret variable and else if/else
|
| |
|
| |
|
|
|
|
|
|
| |
The API is called EVP_CIPHER_CTX_set_key_length() it has an argument called
keylen and, the EVP_CIPHER_CTX's member is called key_len. One of the three
is trivial to adjust, so do it.
|
| |
|
|
|
|
|
| |
The EVP_CIPHER *ctx (yes) is renamed to cipher, otmp becomes an aobj.
Change two !ptr to ptr == NULL checks.
|
|
|
|
| |
Not c (which is most of the time an EVP_CIPHER) or a (?!).
|
|
|
|
|
|
|
|
|
| |
Replace > with >= for the upper array bound to disallow a 4 byte
overread. For RSA you can read the padding mode and for DH past
the DH_PKEY_CTX. Unfortunately, Ruby thought it important to use
this, so we can't kill it easily.
ok miod
|
| |
|
|
|
|
|
| |
These aren't particularly helpful and should probably both be expanded.
For now move them to the only place where they are actually used.
|
|
|
|
|
|
|
| |
This was only used to avoid an ameth lookup in EVP_PKEY_set_type(), a
micro-optimization that was removed in p_lib.c r1.48.
ok jsing
|
| |
|
|
|
|
| |
requested by jsing
|
|
|
|
|
|
|
|
|
| |
If all you have is OBJ_bsearch_(), everything looks like a nail. This
changes a binary search over a list of 12 elements with a lookup via
a switch.
switch suggested by claudio
ok jsing
|
| |
|
|
|
|
|
| |
This is an internal function and you can't hold the required mutex
to call it anyway since that's internal, too.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Validate that every alias resolves to a non-alias in one step and that
non-aliases have pkey_id == pkey_base_id, an info string and a pem_str.
They can be looked up by their pkey_id or pem_str.
Conversely, all these are false for aliases.
|
|
|
|
|
|
|
|
|
| |
In SSL{_CTX}_use_RSAPrivateKey() switch from EVP_PKEY_assign_RSA() to
EVP_PKEY_set1_RSA() and hold on to the reference of the the pkey for
the duration of ssl_set_pkey(). Use single exit and other minor style
cleanups.
ok joshua jsing
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This removes any mention of DSA_generate_parameters in the manuals apart
from a comment that it is intentionally undocumented and adapts cross
references to DSA_generate_parameters_ex. The file itself will be moved
in a second step.
|
| |
|
|
|
|
| |
ok jsing
|
|
|
|
|
|
| |
As per usual. Stylistic adjustments and missing error check.
ok jsing
|
|
|
|
|
|
|
|
| |
This aligns eckey's parameter decoding routine with the one of other
cipher abstractions: better variable names, single exit and add missing
check for EVP_PKEY_assign_EC_KEY().
ok jsing
|
|
|
|
|
|
|
|
|
| |
Factor out the pubkey computation and bring it into more sensible form.
This removes lots of pointless setting of errors (twice) and makes the
code a bit easier on the eyes. Other than that perform some stylistic
cleanup like single exit and add an error check for EVP_PKEY_assign().
ok jsing
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The TLSv1.3 stack didn't support this in the first place, and in the legacy
stack it only added some dubious BIO_flush(3) calls. The sleep call between
SSL_read(3) and SSL_write(3) advertised in the comment next to the flag has
been a sleep call in the s_server since time immemorial, nota bene between
calls to BIO_gets(3). Anyway. This can all go and what remains will go with
the next major bump.
ok jsing
|
|
|
|
|
|
|
|
| |
This undocumented, incomplete public function has never done anything
useful. It will be removed from libssl. Removing it from openssl(1)
clears the way for this.
ok jsing
|