Projet

Général

Profil

0001-replace-use-of-xmlsec-soap.h-which-is-deprecated-fix.patch

Benjamin Dauvergne, 06 octobre 2017 16:03

Télécharger (4,89 ko)

Voir les différences:

Subject: [PATCH] replace use of <xmlsec/soap.h> which is deprecated (fixes
 #18771)

 lasso/id-wsf/wsf_profile.c |   2 +-
 lasso/xml/tools.c          |   2 +-
 lasso/xml/xmlsec_soap.h    | 112 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+), 2 deletions(-)
 create mode 100644 lasso/xml/xmlsec_soap.h
lasso/id-wsf/wsf_profile.c
29 29
#include <xmlsec/xmldsig.h>
30 30
#include <xmlsec/templates.h>
31 31
#include <xmlsec/crypto.h>
32
#include <xmlsec/soap.h>
33 32

  
34 33
#include "../utils.h"
35 34

  
......
60 59
#include "../id-ff/providerprivate.h"
61 60
#include "../id-ff/sessionprivate.h"
62 61
#include "../xml/misc_text_node.h"
62
#include <../xml/xmlsec_soap.h>
63 63

  
64 64
/**
65 65
 * SECTION:wsf_profile
lasso/xml/tools.c
57 57
#include <xmlsec/errors.h>
58 58
#include <xmlsec/openssl/x509.h>
59 59
#include <xmlsec/openssl/crypto.h>
60
#include <xmlsec/soap.h>
61 60

  
62 61
#include <zlib.h>
63 62

  
......
71 70
#include <stdarg.h>
72 71
#include <ctype.h>
73 72
#include "../lasso_config.h"
73
#include <lasso/xml/xmlsec_soap.h>
74 74

  
75 75
/**
76 76
 * SECTION:tools
lasso/xml/xmlsec_soap.h
1
/* $Id$
2
 *
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
4
 *
5
 * Copyright (C) 2004-2007 Entr'ouvert
6
 * http://lasso.entrouvert.org
7
 *
8
 * Authors: See AUTHORS file in top-level directory.
9
 *
10
 * This program is free software; you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation; either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22
 */
23

  
24
#ifndef __LASSO_XMLSEC_SOAP_H__
25
#define __LASSO_XMLSEC_SOAP_H__
26

  
27
#ifdef __cplusplus
28
extern "C" {
29
#endif /* __cplusplus */
30

  
31
#include <libxml/tree.h>
32

  
33
#include <xmlsec/xmlsec.h>
34
#include <xmlsec/xmltree.h>
35
#include <xmlsec/errors.h>
36

  
37

  
38
/** Replacement for xmlsec/soap.h */
39

  
40
#define xmlSecSoap11Ns ((xmlChar*)"http://schemas.xmlsoap.org/soap/envelope/")
41
#define xmlSecSoap12Ns ((xmlChar*)"http://www.w3.org/2003/05/soap-envelope")
42

  
43
static inline xmlNodePtr
44
xmlSecSoap11GetHeader(xmlNodePtr envNode) {
45
    xmlNodePtr cur;
46

  
47
    xmlSecAssert2(envNode != NULL, NULL);
48

  
49
    /* optional Header node is first */
50
    cur = xmlSecGetNextElementNode(envNode->children);
51
    if((cur != NULL) && xmlSecCheckNodeName(cur, xmlSecNodeHeader, xmlSecSoap11Ns)) {
52
        return(cur);
53
    }
54

  
55
    return(NULL);
56
}
57

  
58
static inline xmlNodePtr
59
xmlSecSoap11GetBody(xmlNodePtr envNode) {
60
    xmlNodePtr cur;
61

  
62
    xmlSecAssert2(envNode != NULL, NULL);
63

  
64
    /* optional Header node first */
65
    cur = xmlSecGetNextElementNode(envNode->children);
66
    if((cur != NULL) && xmlSecCheckNodeName(cur, xmlSecNodeHeader, xmlSecSoap11Ns)) {
67
        cur = xmlSecGetNextElementNode(cur->next);
68
    }
69

  
70
    /* Body node is next */
71
    if((cur == NULL) || !xmlSecCheckNodeName(cur, xmlSecNodeBody, xmlSecSoap11Ns)) {
72
        xmlSecError(XMLSEC_ERRORS_HERE,
73
                    NULL,
74
                    xmlSecErrorsSafeString(xmlSecNodeBody),
75
                    XMLSEC_ERRORS_R_NODE_NOT_FOUND,
76
                    XMLSEC_ERRORS_NO_MESSAGE);
77
        return(NULL);
78
    }
79

  
80
    return(cur);
81
}
82

  
83
static inline xmlNodePtr
84
xmlSecSoap12GetBody(xmlNodePtr envNode) {
85
    xmlNodePtr cur;
86

  
87
    xmlSecAssert2(envNode != NULL, NULL);
88

  
89
    /* optional Header node first */
90
    cur = xmlSecGetNextElementNode(envNode->children);
91
    if((cur != NULL) && xmlSecCheckNodeName(cur, xmlSecNodeHeader, xmlSecSoap12Ns)) {
92
        cur = xmlSecGetNextElementNode(cur->next);
93
    }
94

  
95
    /* Body node is next */
96
    if((cur == NULL) || !xmlSecCheckNodeName(cur, xmlSecNodeBody, xmlSecSoap12Ns)) {
97
        xmlSecError(XMLSEC_ERRORS_HERE,
98
                    NULL,
99
                    xmlSecErrorsSafeString(xmlSecNodeBody),
100
                    XMLSEC_ERRORS_R_NODE_NOT_FOUND,
101
                    XMLSEC_ERRORS_NO_MESSAGE);
102
        return(NULL);
103
    }
104

  
105
    return(cur);
106
}
107

  
108
#ifdef __cplusplus
109
}
110
#endif /* __cplusplus */
111

  
112
#endif /* __LASSO_XMLSEC_SOAP_H__ */
0
-