MCPcopy Create free account
hub / github.com/OpenPrinting/cups / httpAddCredential

Function httpAddCredential

cups/http.c:223–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221 */
222
223int /* O - 0 on success, -1 on error */
224httpAddCredential(
225 cups_array_t *credentials, /* I - Credentials array */
226 const void *data, /* I - PEM-encoded X.509 data */
227 size_t datalen) /* I - Length of data */
228{
229 http_credential_t *credential; /* Credential data */
230
231
232 if ((credential = malloc(sizeof(http_credential_t))) != NULL)
233 {
234 credential->datalen = datalen;
235
236 if ((credential->data = malloc(datalen)) != NULL)
237 {
238 memcpy(credential->data, data, datalen);
239 cupsArrayAdd(credentials, credential);
240 return (0);
241 }
242
243 free(credential);
244 }
245
246 return (-1);
247}
248
249
250/*

Callers 8

httpCopyCredentialsFunction · 0.85
httpLoadCredentialsFunction · 0.85
httpCopyCredentialsFunction · 0.85
httpLoadCredentialsFunction · 0.85
httpCopyCredentialsFunction · 0.85
httpLoadCredentialsFunction · 0.85
httpCopyCredentialsFunction · 0.85
httpLoadCredentialsFunction · 0.85

Calls 1

cupsArrayAddFunction · 0.85

Tested by

no test coverage detected