~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source4/heimdal/lib/hx509/req.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 */
47
47
 
48
48
int
49
 
_hx509_request_init(hx509_context context, hx509_request *req)
 
49
hx509_request_init(hx509_context context, hx509_request *req)
50
50
{
51
51
    *req = calloc(1, sizeof(**req));
52
52
    if (*req == NULL)
56
56
}
57
57
 
58
58
void
59
 
_hx509_request_free(hx509_request *req)
 
59
hx509_request_free(hx509_request *req)
60
60
{
61
61
    if ((*req)->name)
62
62
        hx509_name_free(&(*req)->name);
69
69
}
70
70
 
71
71
int
72
 
_hx509_request_set_name(hx509_context context,
 
72
hx509_request_set_name(hx509_context context,
73
73
                        hx509_request req,
74
74
                        hx509_name name)
75
75
{
84
84
}
85
85
 
86
86
int
87
 
_hx509_request_get_name(hx509_context context,
 
87
hx509_request_get_name(hx509_context context,
88
88
                        hx509_request req,
89
89
                        hx509_name *name)
90
90
{
96
96
}
97
97
 
98
98
int
99
 
_hx509_request_set_SubjectPublicKeyInfo(hx509_context context,
 
99
hx509_request_set_SubjectPublicKeyInfo(hx509_context context,
100
100
                                        hx509_request req,
101
101
                                        const SubjectPublicKeyInfo *key)
102
102
{
105
105
}
106
106
 
107
107
int
108
 
_hx509_request_get_SubjectPublicKeyInfo(hx509_context context,
 
108
hx509_request_get_SubjectPublicKeyInfo(hx509_context context,
109
109
                                        hx509_request req,
110
110
                                        SubjectPublicKeyInfo *key)
111
111
{
143
143
 
144
144
    memset(&name, 0, sizeof(name));
145
145
    name.element = choice_GeneralName_dNSName;
146
 
    name.u.dNSName = rk_UNCONST(hostname);
 
146
    name.u.dNSName.data = rk_UNCONST(hostname);
 
147
    name.u.dNSName.length = strlen(hostname);
147
148
 
148
149
    return add_GeneralNames(&req->san, &name);
149
150
}
157
158
 
158
159
    memset(&name, 0, sizeof(name));
159
160
    name.element = choice_GeneralName_rfc822Name;
160
 
    name.u.dNSName = rk_UNCONST(email);
 
161
    name.u.dNSName.data = rk_UNCONST(email);
 
162
    name.u.dNSName.length = strlen(email);
161
163
 
162
164
    return add_GeneralNames(&req->san, &name);
163
165
}
269
271
        return ret;
270
272
    }
271
273
 
272
 
    ret = _hx509_request_init(context, req);
 
274
    ret = hx509_request_init(context, req);
273
275
    if (ret) {
274
276
        free_CertificationRequest(&r);
275
277
        return ret;
277
279
 
278
280
    rinfo = &r.certificationRequestInfo;
279
281
 
280
 
    ret = _hx509_request_set_SubjectPublicKeyInfo(context, *req,
 
282
    ret = hx509_request_set_SubjectPublicKeyInfo(context, *req,
281
283
                                                  &rinfo->subjectPKInfo);
282
284
    if (ret) {
283
285
        free_CertificationRequest(&r);
284
 
        _hx509_request_free(req);
 
286
        hx509_request_free(req);
285
287
        return ret;
286
288
    }
287
289
 
288
290
    ret = _hx509_name_from_Name(&rinfo->subject, &subject);
289
291
    if (ret) {
290
292
        free_CertificationRequest(&r);
291
 
        _hx509_request_free(req);
 
293
        hx509_request_free(req);
292
294
        return ret;
293
295
    }
294
 
    ret = _hx509_request_set_name(context, *req, subject);
 
296
    ret = hx509_request_set_name(context, *req, subject);
295
297
    hx509_name_free(&subject);
296
298
    free_CertificationRequest(&r);
297
299
    if (ret) {
298
 
        _hx509_request_free(req);
 
300
        hx509_request_free(req);
299
301
        return ret;
300
302
    }
301
303