[NETCONF-450] Failed to decrypt encoded data while mounting NETCONF Created: 10/Aug/17 Updated: 15/Mar/19 Resolved: 12/Oct/17 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | netconf |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Marek Gradzki | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 8971 |
| Description |
|
I am using TCP feature:install odl-netconf-topology odl-restconf-all then { } Mount itself works fine, but following error is dsplayed: 2017-08-10 06:29:47,848 | ERROR | on-dispatcher-43 | AAAEncryptionServiceImpl | 223 - org.opendaylight.aaa.encrypt-service - 0.6.0.SNAPSHOT | Failed to decrypt encoded data |
| Comments |
| Comment by Marek Gradzki [ 10/Aug/17 ] |
|
Same issue occurs when SSH is used |
| Comment by Jakub Morvay [ 10/Aug/17 ] |
|
Well, this is related to mountpoint's credentials encryption and not to the actual encryption of netconf session, so it does not really matter whether you are using SSH or TCP. I can confirm that this error is being emitted, but otherwise mountpoint seems to work. |
| Comment by Marek Gradzki [ 10/Aug/17 ] |
|
Right. Thanks for investigation! |
| Comment by Jakub Morvay [ 10/Aug/17 ] |
|
After brief investigation, it turns out, that the password encryption logic during mountpoint initialization goes as follows: 1) netconf node's password is tried to be decrypted with help of AAA AAAEncryptionService's decrypt method. If the password cannot be decrypted, method returns password unchanged and logs the above mentioned error. Our implementation depends on the fact that unencrypted password is returned unchanged (this is not even documented in the netconf code nor in the AAA's AAAEncryptionService API). If the password is already encrypted (thus can be decrypted), we are not doing anything. I guess this wants to solve the problems with reconnects after ODL restart and similar cases (we don't want to encrypt already encrypted password in DS). 2) password is actually encrypted and stored in DS. I think this is not the best solution, since the error log is being emitted and this can confuse users. But also this can cause problems if someone specifies plaintext password that actually can be decrypted (although this is very unlikely scenario). ODL will then try to use decrypted plaintext password during session negotiation with device and not the actual password. |
| Comment by Tomas Cere [ 12/Oct/17 ] |
|
Jakub is correct that this is harmlessly coming from AAA when you have unencrypted password stored, best way to get rid of this and attempting to decrypt unencrypted passwords is to just change to model for credentials like I proposed in https://bugs.opendaylight.org/show_bug.cgi?id=9261 and only run encryption/decryption in the cases that need it. |