comparison common/listutil.c @ 93:0798b9e35725

Check parameters in verify list
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 21 Mar 2014 09:48:46 +0000
parents 4980b0deb773
children b0579d4fa186
comparison
equal deleted inserted replaced
92:4980b0deb773 93:0798b9e35725
106 char signature_b64[sig_b64_size + 1]; 106 char signature_b64[sig_b64_size + 1];
107 unsigned char signature[sig_size]; 107 unsigned char signature[sig_size];
108 /* Hash algroithm is sha256 */ 108 /* Hash algroithm is sha256 */
109 unsigned char hash[32]; 109 unsigned char hash[32];
110 110
111 if (!data || !size) {
112 return -1;
113 }
114
111 /* Fetch the signature from the first line od data */ 115 /* Fetch the signature from the first line od data */
112 p = strchr(data, '\r'); 116 p = strchr(data, '\r');
113 if (p == 0 || (unsigned int)(p - (data + 2)) != sig_b64_size) { 117 if (p == 0 || (unsigned int)(p - (data + 2)) != sig_b64_size) {
114 /* printf("Invalid data. Signature might be too long.\n"); */ 118 /* printf("Invalid data. Signature might be too long.\n"); */
115 return -1; 119 return -1;

http://wald.intevation.org/projects/trustbridge/