@@ -142,7 +142,7 @@ impl Cipher {
142
142
}
143
143
144
144
/// Requires OpenSSL 1.1.0 or newer.
145
- #[ cfg( ossl110) ]
145
+ #[ cfg( all ( ossl110, not ( osslconf = "OPENSSL_NO_OCB" ) ) ) ]
146
146
pub fn aes_128_ocb ( ) -> Cipher {
147
147
unsafe { Cipher ( ffi:: EVP_aes_128_ocb ( ) ) }
148
148
}
@@ -187,7 +187,7 @@ impl Cipher {
187
187
}
188
188
189
189
/// Requires OpenSSL 1.1.0 or newer.
190
- #[ cfg( ossl110) ]
190
+ #[ cfg( all ( ossl110, not ( osslconf = "OPENSSL_NO_OCB" ) ) ) ]
191
191
pub fn aes_192_ocb ( ) -> Cipher {
192
192
unsafe { Cipher ( ffi:: EVP_aes_192_ocb ( ) ) }
193
193
}
@@ -237,7 +237,7 @@ impl Cipher {
237
237
}
238
238
239
239
/// Requires OpenSSL 1.1.0 or newer.
240
- #[ cfg( ossl110) ]
240
+ #[ cfg( all ( ossl110, not ( osslconf = "OPENSSL_NO_OCB" ) ) ) ]
241
241
pub fn aes_256_ocb ( ) -> Cipher {
242
242
unsafe { Cipher ( ffi:: EVP_aes_256_ocb ( ) ) }
243
243
}
@@ -402,14 +402,14 @@ impl Cipher {
402
402
}
403
403
404
404
/// Determines whether the cipher is using OCB mode
405
- #[ cfg( ossl110) ]
405
+ #[ cfg( all ( ossl110, not ( osslconf = "OPENSSL_NO_OCB" ) ) ) ]
406
406
fn is_ocb ( self ) -> bool {
407
407
self == Cipher :: aes_128_ocb ( )
408
408
|| self == Cipher :: aes_192_ocb ( )
409
409
|| self == Cipher :: aes_256_ocb ( )
410
410
}
411
411
412
- #[ cfg( not( ossl110) ) ]
412
+ #[ cfg( any ( not( ossl110) , osslconf = "OPENSSL_NO_OCB" ) ) ]
413
413
const fn is_ocb ( self ) -> bool {
414
414
false
415
415
}
@@ -1422,7 +1422,7 @@ mod tests {
1422
1422
}
1423
1423
1424
1424
#[ test]
1425
- #[ cfg( ossl110) ]
1425
+ #[ cfg( all ( ossl110, not ( osslconf = "OPENSSL_NO_OCB" ) ) ) ]
1426
1426
fn test_aes_128_ocb ( ) {
1427
1427
let key = "000102030405060708090a0b0c0d0e0f" ;
1428
1428
let aad = "0001020304050607" ;
@@ -1458,7 +1458,7 @@ mod tests {
1458
1458
}
1459
1459
1460
1460
#[ test]
1461
- #[ cfg( ossl110) ]
1461
+ #[ cfg( all ( ossl110, not ( osslconf = "OPENSSL_NO_OCB" ) ) ) ]
1462
1462
fn test_aes_128_ocb_fail ( ) {
1463
1463
let key = "000102030405060708090a0b0c0d0e0f" ;
1464
1464
let aad = "0001020304050607" ;
0 commit comments