Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused $refNode in EncryptBody method #60

Open
edomato opened this issue Mar 19, 2021 · 1 comment
Open

Unused $refNode in EncryptBody method #60

edomato opened this issue Mar 19, 2021 · 1 comment

Comments

@edomato
Copy link

edomato commented Mar 19, 2021

wse-php/src/WSSESoap.php

Lines 438 to 447 in c9611f5

$refNode = $encNode->firstChild;
while ($refNode && $refNode->nodeType != XML_ELEMENT_NODE) {
$refNode = $refNode->nextSibling;
}
if ($refNode) {
$refNode = $refNode->nextSibling;
}
if ($this->addEncryptedKey($encNode, $enc, $token)) {
$this->AddReference($enc->encKey, $guid);
}

The $refNode variable is not used on this method, even more, I couldn't find the use of this method anywhere.

It seems there's two way to encrypt the Body, this mentioned method and the encryptSoapDoc method which can also encrypt the Signature.

So, why thereś two way to do the same thing?, any advantage of one over the other?, and what about the unused variable? 😄

Greets and thanks.
Ernesto

@robrichards
Copy link
Owner

refNode is probably from some old left over code. I will look at removing it. As for the 2 methods, also very old and I am assuming the encryptBody method was the first method supported for encryption, and kept for BC reasons, with the other added later with more functionality. These versions predate the git history and I really don't remember anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants