secerror.cxx (c82f2877) | secerror.cxx (8ca5c324) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 2 * |
3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at | 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 | 20 *************************************************************/ 21 22 23 |
24 | |
25#include "secerr.h" 26#include "sslerr.h" 27#include "nspr.h" 28#include "certt.h" 29 30#include "../diagnose.hxx" 31 32using namespace xmlsecurity; --- 4 unchanged lines hidden (view full) --- 37}; 38 39 40 41const ErrDesc allDesc[] = { 42 43#include "certerrors.h" 44 | 24#include "secerr.h" 25#include "sslerr.h" 26#include "nspr.h" 27#include "certt.h" 28 29#include "../diagnose.hxx" 30 31using namespace xmlsecurity; --- 4 unchanged lines hidden (view full) --- 36}; 37 38 39 40const ErrDesc allDesc[] = { 41 42#include "certerrors.h" 43 |
45}; | 44}; |
46 47 48 49/* Returns a UTF-8 encoded constant error string for "errNum". 50 * Returns NULL of errNum is unknown. 51 */ 52const char * 53getCertError(PRErrorCode errNum) --- 12 unchanged lines hidden (view full) --- 66void 67printChainFailure(CERTVerifyLog *log) 68{ 69 unsigned long errorFlags = 0; 70 unsigned int depth = (unsigned int)-1; 71 const char * specificError = NULL; 72 const char * issuer = NULL; 73 CERTVerifyLogNode *node = NULL; | 45 46 47 48/* Returns a UTF-8 encoded constant error string for "errNum". 49 * Returns NULL of errNum is unknown. 50 */ 51const char * 52getCertError(PRErrorCode errNum) --- 12 unchanged lines hidden (view full) --- 65void 66printChainFailure(CERTVerifyLog *log) 67{ 68 unsigned long errorFlags = 0; 69 unsigned int depth = (unsigned int)-1; 70 const char * specificError = NULL; 71 const char * issuer = NULL; 72 CERTVerifyLogNode *node = NULL; |
74 | 73 |
75 if (log->count > 0) 76 { | 74 if (log->count > 0) 75 { |
77 xmlsec_trace("Bad certifcation path:"); | 76 xmlsec_trace("Bad certification path:"); |
78 for (node = log->head; node; node = node->next) 79 { 80 if (depth != node->depth) 81 { 82 depth = node->depth; 83 xmlsec_trace("Certificate: %d. %s %s:", depth, | 77 for (node = log->head; node; node = node->next) 78 { 79 if (depth != node->depth) 80 { 81 depth = node->depth; 82 xmlsec_trace("Certificate: %d. %s %s:", depth, |
84 node->cert->subjectName, | 83 node->cert->subjectName, |
85 depth ? "[Certificate Authority]": ""); 86 } 87 xmlsec_trace(" ERROR %ld: %s", node->error, 88 getCertError(node->error)); 89 specificError = NULL; 90 issuer = NULL; 91 switch (node->error) 92 { --- 55 unchanged lines hidden (view full) --- 148 break; 149 default: 150 break; 151 } 152 if (specificError) 153 xmlsec_trace("%s", specificError); 154 if (issuer) 155 xmlsec_trace("%s", issuer); | 84 depth ? "[Certificate Authority]": ""); 85 } 86 xmlsec_trace(" ERROR %ld: %s", node->error, 87 getCertError(node->error)); 88 specificError = NULL; 89 issuer = NULL; 90 switch (node->error) 91 { --- 55 unchanged lines hidden (view full) --- 147 break; 148 default: 149 break; 150 } 151 if (specificError) 152 xmlsec_trace("%s", specificError); 153 if (issuer) 154 xmlsec_trace("%s", issuer); |
156 } | 155 } |
157 } 158} | 156 } 157} |