On Fri, Jan 06, 2023 at 11:39:03PM -0600, Purple Rain wrote:
> Hi, everyone! Some spelling fixes for libcrypto.
> 
> I added a diff for revision.

Thanks. You can't just change the name of a constant in a public header.
Some code out there might use it and no longer compile after we commit
your diff. For example, Python uses the error codes internally.

OpenSSL fixed this spelling error in 1.1:

https://github.com/openssl/openssl/pull/1421

It turns out that Python uses the version without typo behind an #ifdef.
The safe way to fix this typo is to keep a compat #define

/* Changed in OpenSSL 1.1 */
#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS

in evp.h. We should probably do this.


> 
> P.
> 
> Index: lib/libcrypto/evp/evp.h
> ===================================================================
> RCS file: /cvs/src/lib/libcrypto/evp/evp.h,v
> retrieving revision 1.112
> diff -u -p -r1.112 evp.h
> --- lib/libcrypto/evp/evp.h   13 Nov 2022 14:04:13 -0000      1.112
> +++ lib/libcrypto/evp/evp.h   7 Jan 2023 03:28:26 -0000
> @@ -1467,7 +1467,7 @@ void ERR_load_EVP_strings(void);
>  #define EVP_R_UNKNOWN_DIGEST                          161
>  #define EVP_R_UNKNOWN_OPTION                          169
>  #define EVP_R_UNKNOWN_PBE_ALGORITHM                   121
> -#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS             135
> +#define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS            135
>  #define EVP_R_UNSUPPORTED_ALGORITHM                   156
>  #define EVP_R_UNSUPPORTED_CIPHER                      107
>  #define EVP_R_UNSUPPORTED_KEYLENGTH                   123
> Index: lib/libcrypto/evp/evp_err.c
> ===================================================================
> RCS file: /cvs/src/lib/libcrypto/evp/evp_err.c,v
> retrieving revision 1.30
> diff -u -p -r1.30 evp_err.c
> --- lib/libcrypto/evp/evp_err.c       10 Nov 2022 15:17:30 -0000      1.30
> +++ lib/libcrypto/evp/evp_err.c       7 Jan 2023 03:28:26 -0000
> @@ -137,7 +137,7 @@ static ERR_STRING_DATA EVP_str_reasons[]
>       {ERR_REASON(EVP_R_UNKNOWN_DIGEST)        , "unknown digest"},
>       {ERR_REASON(EVP_R_UNKNOWN_OPTION)        , "unknown option"},
>       {ERR_REASON(EVP_R_UNKNOWN_PBE_ALGORITHM) , "unknown pbe algorithm"},
> -     {ERR_REASON(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS), "unsuported number of 
> rounds"},
> +     {ERR_REASON(EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS), "unsupported number of 
> rounds"},
>       {ERR_REASON(EVP_R_UNSUPPORTED_ALGORITHM) , "unsupported algorithm"},
>       {ERR_REASON(EVP_R_UNSUPPORTED_CIPHER)    , "unsupported cipher"},
>       {ERR_REASON(EVP_R_UNSUPPORTED_KEYLENGTH) , "unsupported keylength"},
> Index: lib/libcrypto/evp/p5_crpt.c
> ===================================================================
> RCS file: /cvs/src/lib/libcrypto/evp/p5_crpt.c,v
> retrieving revision 1.21
> diff -u -p -r1.21 p5_crpt.c
> --- lib/libcrypto/evp/p5_crpt.c       26 Nov 2022 16:08:52 -0000      1.21
> +++ lib/libcrypto/evp/p5_crpt.c       7 Jan 2023 03:28:26 -0000
> @@ -109,7 +109,7 @@ PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx,
>       if (!pbe->iter)
>               iter = 1;
>       else if ((iter = ASN1_INTEGER_get(pbe->iter)) <= 0) {
> -             EVPerror(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS);
> +             EVPerror(EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS);
>               PBEPARAM_free(pbe);
>               return 0;
>       }
> Index: lib/libcrypto/evp/p5_crpt2.c
> ===================================================================
> RCS file: /cvs/src/lib/libcrypto/evp/p5_crpt2.c,v
> retrieving revision 1.25
> diff -u -p -r1.25 p5_crpt2.c
> --- lib/libcrypto/evp/p5_crpt2.c      26 Nov 2022 16:08:52 -0000      1.25
> +++ lib/libcrypto/evp/p5_crpt2.c      7 Jan 2023 03:28:26 -0000
> @@ -290,7 +290,7 @@ PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX 
>       salt = kdf->salt->value.octet_string->data;
>       saltlen = kdf->salt->value.octet_string->length;
>       if ((iter = ASN1_INTEGER_get(kdf->iter)) <= 0) {
> -             EVPerror(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS);
> +             EVPerror(EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS);
>               goto err;
>       }
>       if (!PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, prfmd,
> 

Reply via email to