| 1 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 2 |
# not use this file except in compliance with the License. You may obtain |
| 3 |
# a copy of the License at |
| 4 |
# |
| 5 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 |
# |
| 7 |
# Unless required by applicable law or agreed to in writing, software |
| 8 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 9 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 10 |
# License for the specific language governing permissions and limitations |
| 11 |
# under the License. |
| 12 |
|
| 13 |
from neutron_lib.api.definitions import vpn |
| 14 |
|
| 15 |
|
| 16 |
ALIAS = 'vpn-aes-ctr' |
| 17 |
IS_SHIM_EXTENSION = True |
| 18 |
IS_STANDARD_ATTR_EXTENSION = False |
| 19 |
NAME = 'VPN support for AES CTR mode' |
| 20 |
DESCRIPTION = 'Add AES CTR choices for encryption algorithm' |
| 21 |
UPDATED_TIMESTAMP = '2024-01-09T09:00:00-00:00' |
| 22 |
SUB_RESOURCE_ATTRIBUTE_MAP = {} |
| 23 |
ACTION_MAP = {} |
| 24 |
REQUIRED_EXTENSIONS = [vpn.ALIAS] |
| 25 |
OPTIONAL_EXTENSIONS = [] |
| 26 |
ACTION_STATUS = {} |
| 27 |
|
| 28 |
# Additional VPN encryption algorithm constants |
| 29 |
VPN_ENCRYPTION_ALGORITHM_AES_128_CTR = 'aes-128-ctr' |
| 30 |
VPN_ENCRYPTION_ALGORITHM_AES_192_CTR = 'aes-192-ctr' |
| 31 |
VPN_ENCRYPTION_ALGORITHM_AES_256_CTR = 'aes-256-ctr' |
| 32 |
|
| 33 |
VPN_SUPPORTED_ENCRYPTION_ALGORITHMS_WITH_CTR = ( |
| 34 |
vpn.VPN_SUPPORTED_ENCRYPTION_ALGORITHMS + [ |
| 35 |
VPN_ENCRYPTION_ALGORITHM_AES_128_CTR, |
| 36 |
VPN_ENCRYPTION_ALGORITHM_AES_192_CTR, |
| 37 |
VPN_ENCRYPTION_ALGORITHM_AES_256_CTR, |
| 38 |
] |
| 39 |
) |
| 40 |
|
| 41 |
|
| 42 |
RESOURCE_ATTRIBUTE_MAP = { |
| 43 |
vpn.IKE_POLICIES: { |
| 44 |
vpn.ENCRYPTION_ALGORITHM: { |
| 45 |
'allow_post': True, |
| 46 |
'allow_put': True, |
| 47 |
'default': vpn.VPN_ENCRYPTION_ALGORITHM_AES_128, |
| 48 |
'validate': { |
| 49 |
'type:values': VPN_SUPPORTED_ENCRYPTION_ALGORITHMS_WITH_CTR}, |
| 50 |
'is_visible': True}, |
| 51 |
}, |
| 52 |
vpn.IPSEC_POLICIES: { |
| 53 |
vpn.ENCRYPTION_ALGORITHM: { |
| 54 |
'allow_post': True, |
| 55 |
'allow_put': True, |
| 56 |
'default': vpn.VPN_ENCRYPTION_ALGORITHM_AES_128, |
| 57 |
'validate': { |
| 58 |
'type:values': VPN_SUPPORTED_ENCRYPTION_ALGORITHMS_WITH_CTR}, |
| 59 |
'is_visible': True}, |
| 60 |
}, |
| 61 |
} |