KB Article #181201

what is the connection between the pvalue and the passphrase that we setup for the nodemanager

Problem


1. Create a .fed protected with a passphrase= "mugur" and export it.

2. Create an ANM image with that .fed

/root/Desktop/docker_may/apigw-emt-scripts-2.1.0-SNAPSHOT/build_anm_image.py --parent-image=api_gw__base_image_centos_7 \

--domain-cert=/root/Desktop/docker_may/apigw-emt-scripts-2.1.0-SNAPSHOT/certs/mydomain/mydomain-cert.pem \
--domain-key=/root/Desktop/docker_may/apigw-emt-scripts-2.1.0-SNAPSHOT/certs/mydomain/mydomain-key.pem \
--domain-key-pass-file=/root/Desktop/docker_may/mugur/pass_certs_domain_mugur.txt \
--anm-username=admin \
--anm-pass-file=/root/Desktop/docker_may/mugur/admin_pass_mugur.txt \
--merge-dir=/root/Desktop/docker_may/apigw-emt-scripts-2.1.0-SNAPSHOT/Dockerfiles/emt-nodemanager/apigateway/ \
--healthcheck \
--metrics \
--metrics-db-url=jdbc:mysql://metricsdb:3306/metrics \
--metrics-db-username=root \
--metrics-db-pass-file=/root/Desktop/docker_may/mugur/mysql_pass_mugur.txt \
--fed /root/Desktop/mugur.fed \
--fed-pass-file /root/Desktop/fed_pass.txt \
--out-image=anm_image_fed


(/root/Desktop/fed_pass.txt contains the "mugur")

3.checking the pvalue field of the nodemanager.xml file we see it is not "mugur" but the "3820322027":

<<

pvalue="3820322027" serviceID="nodemanager-1"
>>


So what is the connection between the "mugur" and "3820322027"?



Resolution

The pvalue is the passphrase obfuscated using a XOR on each character with 0x55

This bash line should do the job to obfuscate it:

#pass="mugur"; for (( i=0; i<${#pass}; i++ )); do d=`printf %d \'${pass:$i:1}`; printf %x $(( $d ^ 0x55 )); done; echo""

3820322027


The inverse function, to go from "3820322027" to "mugur" is:

#obfuscated="3820322027"; for (( i=0; i<${#obfuscated}; i+=2 )); do x=`printf %d 0x${obfuscated:$i:2}`; d=`printf $(( $x ^ 0x55 ));`; printf \\$(printf '%03o' $d); done; echo""
mugur