Ignore:
Timestamp:
Jul 19, 2016, 2:39:26 PM (4 years ago)
Author:
dcorreia
Message:

Added features of second part of configuration process: subject mapping, card certificate operations and pam-configs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/linuxloginsmartcardwizard/trunk/project1/main.py

    r16337 r16345  
    1414PAMPKCS11_CONFIG = "/etc/pam_pkcs11/pam_pkcs11.conf"
    1515PTEID_MODULE = "pteid.txt"
     16SUBJECTMAPPING_EXAMPLE = "/usr/share/doc/libpam-pkcs11/examples/subject_mapping.example"
     17PAMPKCS11_MAPPING = "/etc/pam_pkcs11/subject_mapping"
     18CARD_DATAFILE = "/tmp/cardData"
     19PAMCONFIG_EXAMPLE = "pkcs11.example"
     20PAMCONFIG = "/usr/share/pam-configs/pkcs11"
    1621
     22# Part 1 - Configuration of PKCS#11 module for PAM
    1723
    1824# Install PKCS#11 module for PAM
     
    4955configpkcs11.testInspect()
    5056
     57# Part 2 - User mapping configuration
     58
     59# Change use_mappers to subject in pam_pkcs11.conf
     60configpkcs11.changeUseMappers("subject", PAMPKCS11_CONFIG)
     61
     62# Copy subject_mapping file to main configuration folder
     63configpkcs11.copyFileToDirectory(SUBJECTMAPPING_EXAMPLE, PAMPKCS11_MAPPING)
     64
     65# Extract user authentication certificate from pkcs11_inspect execution
     66configpkcs11.getCardAuthCertificate(CARD_DATAFILE)
     67
     68# Add certificate->user mapping to subject_mapping file
     69username = input("Please write the username to used in the mapping\n")
     70configpkcs11.addUserMapping(CARD_DATAFILE, PAMPKCS11_MAPPING, username)
     71
     72# Create the pkcs11 file with configuration info
     73configpkcs11.copyFileToDirectory(PAMCONFIG_EXAMPLE, PAMCONFIG)
     74
     75# TODO Use pam-auth-update to activate the new configurations
     76
     77
     78# TODO Check configurations by looking at the common-auth file
     79
     80
     81
     82
Note: See TracChangeset for help on using the changeset viewer.