| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x_attrib.c | 
| Source code | Switch to Preprocessed file | 
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | /* | - | ||||||
| 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. | - | ||||||
| 3 | * | - | ||||||
| 4 | * Licensed under the OpenSSL license (the "License"). You may not use | - | ||||||
| 5 | * this file except in compliance with the License. You can obtain a copy | - | ||||||
| 6 | * in the file LICENSE in the source distribution or at | - | ||||||
| 7 | * https://www.openssl.org/source/license.html | - | ||||||
| 8 | */ | - | ||||||
| 9 | - | |||||||
| 10 | #include <stdio.h> | - | ||||||
| 11 | #include "internal/cryptlib.h" | - | ||||||
| 12 | #include <openssl/objects.h> | - | ||||||
| 13 | #include <openssl/asn1t.h> | - | ||||||
| 14 | #include <openssl/x509.h> | - | ||||||
| 15 | #include "x509_lcl.h" | - | ||||||
| 16 | - | |||||||
| 17 | /*- | - | ||||||
| 18 | * X509_ATTRIBUTE: this has the following form: | - | ||||||
| 19 | * | - | ||||||
| 20 | * typedef struct x509_attributes_st | - | ||||||
| 21 | * { | - | ||||||
| 22 | * ASN1_OBJECT *object; | - | ||||||
| 23 | * STACK_OF(ASN1_TYPE) *set; | - | ||||||
| 24 | * } X509_ATTRIBUTE; | - | ||||||
| 25 | * | - | ||||||
| 26 | */ | - | ||||||
| 27 | - | |||||||
| 28 | ASN1_SEQUENCE(X509_ATTRIBUTE) = { | - | ||||||
| 29 | ASN1_SIMPLE(X509_ATTRIBUTE, object, ASN1_OBJECT), | - | ||||||
| 30 | ASN1_SET_OF(X509_ATTRIBUTE, set, ASN1_ANY) | - | ||||||
| 31 | } ASN1_SEQUENCE_END(X509_ATTRIBUTE) | - | ||||||
| 32 | - | |||||||
| 33 | IMPLEMENT_ASN1_FUNCTIONS(X509_ATTRIBUTE) executed 209 times by 1 test:  end of blockExecuted by: 
 never executed:  return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ATTRIBUTE_it)));never executed:  return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ATTRIBUTE_it)));executed 288 times by 1 test:  return (X509_ATTRIBUTE *)ASN1_item_new((&(X509_ATTRIBUTE_it)));Executed by: 
 | 0-288 | ||||||
| 34 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_ATTRIBUTE) executed 209 times by 1 test:  return ASN1_item_dup((&(X509_ATTRIBUTE_it)), x);Executed by: 
 | 209 | ||||||
| 35 | - | |||||||
| 36 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value) | - | ||||||
| 37 | { | - | ||||||
| 38 | X509_ATTRIBUTE *ret = NULL; | - | ||||||
| 39 | ASN1_TYPE *val = NULL; | - | ||||||
| 40 | - | |||||||
| 41 | if ((ret = X509_ATTRIBUTE_new()) == NULL) 
 | 0-79 | ||||||
| 42 | return NULL; never executed:  return ((void *)0) ; | 0 | ||||||
| 43 | ret->object = OBJ_nid2obj(nid); | - | ||||||
| 44 | if ((val = ASN1_TYPE_new()) == NULL) 
 | 0-79 | ||||||
| 45 | goto err; never executed:  goto err; | 0 | ||||||
| 46 | if (!sk_ASN1_TYPE_push(ret->set, val)) 
 | 0-79 | ||||||
| 47 | goto err; never executed:  goto err; | 0 | ||||||
| 48 | - | |||||||
| 49 | ASN1_TYPE_set(val, atrtype, value); | - | ||||||
| 50 | return ret; executed 79 times by 1 test:  return ret;Executed by: 
 | 79 | ||||||
| 51 | err: | - | ||||||
| 52 | X509_ATTRIBUTE_free(ret); | - | ||||||
| 53 | ASN1_TYPE_free(val); | - | ||||||
| 54 | return NULL; never executed:  return ((void *)0) ; | 0 | ||||||
| 55 | } | - | ||||||
| Source code | Switch to Preprocessed file |