Skip to content

Commit

Permalink
Put <ds:Signature> as the first child for enveloped signature.
Browse files Browse the repository at this point in the history
The current code has two issues:

(1) It add sig to the signed element's Child, but does NOT update the index and parent. It should call "Element.AddChild(t)" 

(2) the <ds:Signature> is added as the last child. But based on SAML standard, this should be the first child.

Both of these issues will be solved by this update.
  • Loading branch information
smstong authored Aug 11, 2023
1 parent de7b553 commit 71fbc7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (ctx *SigningContext) SignEnveloped(el *etree.Element) (*etree.Element, err
}

ret := el.Copy()
ret.Child = append(ret.Child, sig)
ret.InsertChildAt(0, sig)

return ret, nil
}
Expand Down

0 comments on commit 71fbc7a

Please sign in to comment.