@@ -300,11 +300,11 @@ int enc_main(int argc, char **argv)
300300 if (!opt_cipher (ciphername , & cipher ))
301301 goto opthelp ;
302302 }
303- if (cipher && EVP_CIPHER_flags (cipher ) & EVP_CIPH_FLAG_AEAD_CIPHER ) {
303+ if (cipher && EVP_CIPHER_get_flags (cipher ) & EVP_CIPH_FLAG_AEAD_CIPHER ) {
304304 BIO_printf (bio_err , "%s: AEAD ciphers not supported\n" , prog );
305305 goto end ;
306306 }
307- if (cipher && (EVP_CIPHER_mode (cipher ) == EVP_CIPH_XTS_MODE )) {
307+ if (cipher && (EVP_CIPHER_get_mode (cipher ) == EVP_CIPH_XTS_MODE )) {
308308 BIO_printf (bio_err , "%s XTS ciphers not supported\n" , prog );
309309 goto end ;
310310 }
@@ -360,7 +360,7 @@ int enc_main(int argc, char **argv)
360360 char prompt [200 ];
361361
362362 BIO_snprintf (prompt , sizeof (prompt ), "enter %s %s password:" ,
363- EVP_CIPHER_name (cipher ),
363+ EVP_CIPHER_get0_name (cipher ),
364364 (enc ) ? "encryption" : "decryption" );
365365 strbuf [0 ] = '\0' ;
366366 i = EVP_read_pw_string ((char * )strbuf , SIZE , prompt , enc );
@@ -492,8 +492,8 @@ int enc_main(int argc, char **argv)
492492 * concatenated into a temporary buffer
493493 */
494494 unsigned char tmpkeyiv [EVP_MAX_KEY_LENGTH + EVP_MAX_IV_LENGTH ];
495- int iklen = EVP_CIPHER_key_length (cipher );
496- int ivlen = EVP_CIPHER_iv_length (cipher );
495+ int iklen = EVP_CIPHER_get_key_length (cipher );
496+ int ivlen = EVP_CIPHER_get_iv_length (cipher );
497497 /* not needed if HASH_UPDATE() is fixed : */
498498 int islen = (sptr != NULL ? sizeof (salt ) : 0 );
499499 if (!PKCS5_PBKDF2_HMAC (str , str_len , sptr , islen ,
@@ -525,7 +525,7 @@ int enc_main(int argc, char **argv)
525525 OPENSSL_cleanse (str , str_len );
526526 }
527527 if (hiv != NULL ) {
528- int siz = EVP_CIPHER_iv_length (cipher );
528+ int siz = EVP_CIPHER_get_iv_length (cipher );
529529 if (siz == 0 ) {
530530 BIO_printf (bio_err , "warning: iv not used by this cipher\n" );
531531 } else if (!set_hex (hiv , iv , siz )) {
@@ -534,7 +534,7 @@ int enc_main(int argc, char **argv)
534534 }
535535 }
536536 if ((hiv == NULL ) && (str == NULL )
537- && EVP_CIPHER_iv_length (cipher ) != 0 ) {
537+ && EVP_CIPHER_get_iv_length (cipher ) != 0 ) {
538538 /*
539539 * No IV was explicitly set and no IV was generated.
540540 * Hence the IV is undefined, making correct decryption impossible.
@@ -543,7 +543,7 @@ int enc_main(int argc, char **argv)
543543 goto end ;
544544 }
545545 if (hkey != NULL ) {
546- if (!set_hex (hkey , key , EVP_CIPHER_key_length (cipher ))) {
546+ if (!set_hex (hkey , key , EVP_CIPHER_get_key_length (cipher ))) {
547547 BIO_printf (bio_err , "invalid hex key value\n" );
548548 goto end ;
549549 }
@@ -563,7 +563,7 @@ int enc_main(int argc, char **argv)
563563
564564 if (!EVP_CipherInit_ex (ctx , cipher , e , NULL , NULL , enc )) {
565565 BIO_printf (bio_err , "Error setting cipher %s\n" ,
566- EVP_CIPHER_name (cipher ));
566+ EVP_CIPHER_get0_name (cipher ));
567567 ERR_print_errors (bio_err );
568568 goto end ;
569569 }
@@ -573,7 +573,7 @@ int enc_main(int argc, char **argv)
573573
574574 if (!EVP_CipherInit_ex (ctx , NULL , NULL , key , iv , enc )) {
575575 BIO_printf (bio_err , "Error setting cipher %s\n" ,
576- EVP_CIPHER_name (cipher ));
576+ EVP_CIPHER_get0_name (cipher ));
577577 ERR_print_errors (bio_err );
578578 goto end ;
579579 }
@@ -590,15 +590,15 @@ int enc_main(int argc, char **argv)
590590 printf ("%02X" , salt [i ]);
591591 printf ("\n" );
592592 }
593- if (EVP_CIPHER_key_length (cipher ) > 0 ) {
593+ if (EVP_CIPHER_get_key_length (cipher ) > 0 ) {
594594 printf ("key=" );
595- for (i = 0 ; i < EVP_CIPHER_key_length (cipher ); i ++ )
595+ for (i = 0 ; i < EVP_CIPHER_get_key_length (cipher ); i ++ )
596596 printf ("%02X" , key [i ]);
597597 printf ("\n" );
598598 }
599- if (EVP_CIPHER_iv_length (cipher ) > 0 ) {
599+ if (EVP_CIPHER_get_iv_length (cipher ) > 0 ) {
600600 printf ("iv =" );
601- for (i = 0 ; i < EVP_CIPHER_iv_length (cipher ); i ++ )
601+ for (i = 0 ; i < EVP_CIPHER_get_iv_length (cipher ); i ++ )
602602 printf ("%02X" , iv [i ]);
603603 printf ("\n" );
604604 }
@@ -661,8 +661,8 @@ static void show_ciphers(const OBJ_NAME *name, void *arg)
661661 /* Filter out ciphers that we cannot use */
662662 cipher = EVP_get_cipherbyname (name -> name );
663663 if (cipher == NULL ||
664- (EVP_CIPHER_flags (cipher ) & EVP_CIPH_FLAG_AEAD_CIPHER ) != 0 ||
665- EVP_CIPHER_mode (cipher ) == EVP_CIPH_XTS_MODE )
664+ (EVP_CIPHER_get_flags (cipher ) & EVP_CIPH_FLAG_AEAD_CIPHER ) != 0 ||
665+ EVP_CIPHER_get_mode (cipher ) == EVP_CIPH_XTS_MODE )
666666 return ;
667667
668668 BIO_printf (dec -> bio , "-%-25s" , name -> name );
0 commit comments