Skip to content

Commit

Permalink
#535 Add new txn to remove non-root certificates
Browse files Browse the repository at this point in the history
Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com>
Signed-off-by: Abdulbois <abdulbois123@gmail.com>
  • Loading branch information
Abdulbois committed Feb 16, 2024
1 parent 19884b1 commit c859d20
Show file tree
Hide file tree
Showing 20 changed files with 1,340 additions and 120 deletions.
69 changes: 47 additions & 22 deletions integration_tests/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,47 +463,69 @@ XWQLy4RZmLIkrm7vj3uFWRpi7lOBkAPOgCm04RTYqJJwnI0UeJmvaxoFd42J+k3D
xEsSrRoqMgkOX01+kkNn8Ugv3bEfeJ4=
-----END CERTIFICATE-----`
IntermediateWithSameSubjectAndSKID1 = `-----BEGIN CERTIFICATE-----
MIIDhzCCAm+gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCVVMx
MIIDlTCCAn2gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCVVMx
ETAPBgNVBAgMCE5ldyBZb3JrMREwDwYDVQQHDAhOZXcgWW9yazEYMBYGA1UECgwP
RXhhbXBsZSBDb21wYW55MRkwFwYDVQQLDBBUZXN0aW5nIERpdmlzaW9uMRgwFgYD
VQQDDA93d3cuZXhhbXBsZS5jb20wIBcNMjQwMjE1MTE1MTE1WhgPMzAyMzA2MTgx
MTUxMTVaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYD
VQQDDA93d3cuZXhhbXBsZS5jb20wIBcNMjQwMjE2MDY1NTA0WhgPMzAyMzA2MTkw
NjU1MDRaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYD
VQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQDmdvkss9fh7NRVNAKbrt9zReTN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/ANg8hOlyr68u0FE+x6pye00TmxcFzDuo
5/OA9jGQln82Z8inmc05wZPQPpjZxdCQteqJkNl7PrklgO5EevG9JlUArIets2Py
2Vciq5eYOIi+PlP+HI5QzlZYxSqFjJrFcfzYCJ4=
-----END CERTIFICATE-----`

RootIssuer = "MDQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApzb21lLXN0YXRlMRAwDgYDVQQKDAdyb290LWNh"
Expand All @@ -521,6 +543,9 @@ sjM+VdY9b/3SGHgGObPXkCdACI0v5kfHiUU5Z0zmNNtyNA0qbOBj8BPkOnq/zd2j
IntermediateCertWithSameSubjectAndSKIDSubjectKeyID = "2E:13:3B:44:52:2C:30:E9:EC:FB:45:FA:5D:E5:04:0A:C1:C6:E6:B9"
IntermediateCertWithSameSubjectAndSKID1SerialNumber = "3"
IntermediateCertWithSameSubjectAndSKID2SerialNumber = "4"
LeafCertWithSameSubjectAndSKIDSubject = "MEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQ="
LeafCertWithSameSubjectAndSKIDSubjectKeyID = "12:16:55:8E:5E:2A:DF:04:D7:E6:FE:D1:53:69:61:98:EF:17:2F:03"
LeafCertWithSameSubjectAndSKIDSerialNumber = "5"

IntermediateIssuer = "MDQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApzb21lLXN0YXRlMRAwDgYDVQQKDAdyb290LWNh"
IntermediateAuthorityKeyID = "5A:88:0E:6C:36:53:D0:7F:B0:89:71:A3:F4:73:79:09:30:E6:2B:DB"
Expand Down
20 changes: 20 additions & 0 deletions integration_tests/constants/leaf_with_same_subject_and_skid
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDSTCCAjGgAwIBAgIBBTANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJBVTET
MBEGA1UECAwKU29tZS1TdGF0ZTEhMB8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12 changes: 12 additions & 0 deletions proto/pki/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ service Msg {
rpc UpdatePkiRevocationDistributionPoint(MsgUpdatePkiRevocationDistributionPoint) returns (MsgUpdatePkiRevocationDistributionPointResponse);
rpc DeletePkiRevocationDistributionPoint(MsgDeletePkiRevocationDistributionPoint) returns (MsgDeletePkiRevocationDistributionPointResponse);
rpc AssignVid(MsgAssignVid) returns (MsgAssignVidResponse);
rpc RemoveX509Cert(MsgRemoveX509Cert) returns (MsgRemoveX509CertResponse);
// this line is used by starport scaffolding # proto/tx/rpc
}

Expand Down Expand Up @@ -156,4 +157,15 @@ message MsgAssignVid {
message MsgAssignVidResponse {
}

message MsgRemoveX509Cert {
string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.moretags) = "validate:\"required\""];
string subject = 2 [(gogoproto.moretags) = "validate:\"required,max=1024\""];
string subjectKeyId = 3 [(gogoproto.moretags) = "validate:\"required,max=256\""];
string serialNumber = 4;
bool removeChild = 5;
}

message MsgRemoveX509CertResponse {
}

// this line is used by starport scaffolding # proto/tx/message
1 change: 1 addition & 0 deletions scripts/starport/upgrade-0.44/07.pki_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ starport scaffold --module pki message AddX509Cert cert --signer signer
starport scaffold --module pki message ProposeRevokeX509RootCert subject subjectKeyId --signer signer
starport scaffold --module pki message ApproveRevokeX509RootCert subject subjectKeyId --signer signer
starport scaffold --module pki message RevokeX509Cert subject subjectKeyId --signer signer
starport scaffold --module pki message RemoveX509Cert subject subjectKeyId serialNumber --signer signer
starport scaffold --module pki message RejectAddX509RootCert cert --signer signer
starport scaffold --module pki message add-pki-revocation-distribution-point vid:uint pid:uint isPAA:bool label crlSignerCertificate issuerSubjectKeyID dataURL dataFileSize:uint dataDigest dataDigestType:uint revocationType:uint --signer signer
starport scaffold --module pki message update-pki-revocation-distribution-point vid:uint label crlSignerCertificate issuerSubjectKeyID dataURL dataFileSize:uint dataDigest dataDigestType:uint --signer signer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { MsgAddPkiRevocationDistributionPoint } from "./types/pki/tx";
import { MsgAddX509Cert } from "./types/pki/tx";
import { MsgApproveRevokeX509RootCert } from "./types/pki/tx";
import { MsgProposeRevokeX509RootCert } from "./types/pki/tx";
import { MsgRemoveX509Cert } from "./types/pki/tx";


const types = [
Expand All @@ -29,7 +30,7 @@ const types = [
["/zigbeealliance.distributedcomplianceledger.pki.MsgAddX509Cert", MsgAddX509Cert],
["/zigbeealliance.distributedcomplianceledger.pki.MsgApproveRevokeX509RootCert", MsgApproveRevokeX509RootCert],
["/zigbeealliance.distributedcomplianceledger.pki.MsgProposeRevokeX509RootCert", MsgProposeRevokeX509RootCert],

["/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveX509Cert", MsgRemoveX509Cert],
];
export const MissingWalletError = new Error("wallet is required");

Expand Down Expand Up @@ -72,7 +73,7 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions =
msgAddX509Cert: (data: MsgAddX509Cert): EncodeObject => ({ typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddX509Cert", value: MsgAddX509Cert.fromPartial( data ) }),
msgApproveRevokeX509RootCert: (data: MsgApproveRevokeX509RootCert): EncodeObject => ({ typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgApproveRevokeX509RootCert", value: MsgApproveRevokeX509RootCert.fromPartial( data ) }),
msgProposeRevokeX509RootCert: (data: MsgProposeRevokeX509RootCert): EncodeObject => ({ typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgProposeRevokeX509RootCert", value: MsgProposeRevokeX509RootCert.fromPartial( data ) }),

msgRemoveX509Cert: (data: MsgRemoveX509Cert): EncodeObject => ({ typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveX509Cert", value: MsgRemoveX509Cert.fromPartial( data ) }),
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export type PkiMsgProposeRevokeX509RootCertResponse = object;

export type PkiMsgRejectAddX509RootCertResponse = object;

export type PkiMsgRemoveX509CertResponse = object;

export type PkiMsgRevokeX509CertResponse = object;

export type PkiMsgUpdatePkiRevocationDistributionPointResponse = object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ export interface MsgAssignVid {

export interface MsgAssignVidResponse {}

export interface MsgRemoveX509Cert {
signer: string
subject: string
subjectKeyId: string
serialNumber: string
removeChild: boolean
}

export interface MsgRemoveX509CertResponse {}

const baseMsgProposeAddX509RootCert: object = { signer: '', cert: '', info: '', time: 0, vid: 0 }

export const MsgProposeAddX509RootCert = {
Expand Down Expand Up @@ -2106,6 +2116,167 @@ export const MsgAssignVidResponse = {
}
}

const baseMsgRemoveX509Cert: object = { signer: '', subject: '', subjectKeyId: '', serialNumber: '', removeChild: false }

export const MsgRemoveX509Cert = {
encode(message: MsgRemoveX509Cert, writer: Writer = Writer.create()): Writer {
if (message.signer !== '') {
writer.uint32(10).string(message.signer)
}
if (message.subject !== '') {
writer.uint32(18).string(message.subject)
}
if (message.subjectKeyId !== '') {
writer.uint32(26).string(message.subjectKeyId)
}
if (message.serialNumber !== '') {
writer.uint32(34).string(message.serialNumber)
}
if (message.removeChild === true) {
writer.uint32(40).bool(message.removeChild)
}
return writer
},

decode(input: Reader | Uint8Array, length?: number): MsgRemoveX509Cert {
const reader = input instanceof Uint8Array ? new Reader(input) : input
let end = length === undefined ? reader.len : reader.pos + length
const message = { ...baseMsgRemoveX509Cert } as MsgRemoveX509Cert
while (reader.pos < end) {
const tag = reader.uint32()
switch (tag >>> 3) {
case 1:
message.signer = reader.string()
break
case 2:
message.subject = reader.string()
break
case 3:
message.subjectKeyId = reader.string()
break
case 4:
message.serialNumber = reader.string()
break
case 5:
message.removeChild = reader.bool()
break
default:
reader.skipType(tag & 7)
break
}
}
return message
},

fromJSON(object: any): MsgRemoveX509Cert {
const message = { ...baseMsgRemoveX509Cert } as MsgRemoveX509Cert
if (object.signer !== undefined && object.signer !== null) {
message.signer = String(object.signer)
} else {
message.signer = ''
}
if (object.subject !== undefined && object.subject !== null) {
message.subject = String(object.subject)
} else {
message.subject = ''
}
if (object.subjectKeyId !== undefined && object.subjectKeyId !== null) {
message.subjectKeyId = String(object.subjectKeyId)
} else {
message.subjectKeyId = ''
}
if (object.serialNumber !== undefined && object.serialNumber !== null) {
message.serialNumber = String(object.serialNumber)
} else {
message.serialNumber = ''
}
if (object.removeChild !== undefined && object.removeChild !== null) {
message.removeChild = Boolean(object.removeChild)
} else {
message.removeChild = false
}
return message
},

toJSON(message: MsgRemoveX509Cert): unknown {
const obj: any = {}
message.signer !== undefined && (obj.signer = message.signer)
message.subject !== undefined && (obj.subject = message.subject)
message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId)
message.serialNumber !== undefined && (obj.serialNumber = message.serialNumber)
message.removeChild !== undefined && (obj.removeChild = message.removeChild)
return obj
},

fromPartial(object: DeepPartial<MsgRemoveX509Cert>): MsgRemoveX509Cert {
const message = { ...baseMsgRemoveX509Cert } as MsgRemoveX509Cert
if (object.signer !== undefined && object.signer !== null) {
message.signer = object.signer
} else {
message.signer = ''
}
if (object.subject !== undefined && object.subject !== null) {
message.subject = object.subject
} else {
message.subject = ''
}
if (object.subjectKeyId !== undefined && object.subjectKeyId !== null) {
message.subjectKeyId = object.subjectKeyId
} else {
message.subjectKeyId = ''
}
if (object.serialNumber !== undefined && object.serialNumber !== null) {
message.serialNumber = object.serialNumber
} else {
message.serialNumber = ''
}
if (object.removeChild !== undefined && object.removeChild !== null) {
message.removeChild = object.removeChild
} else {
message.removeChild = false
}
return message
}
}

const baseMsgRemoveX509CertResponse: object = {}

export const MsgRemoveX509CertResponse = {
encode(_: MsgRemoveX509CertResponse, writer: Writer = Writer.create()): Writer {
return writer
},

decode(input: Reader | Uint8Array, length?: number): MsgRemoveX509CertResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input
let end = length === undefined ? reader.len : reader.pos + length
const message = { ...baseMsgRemoveX509CertResponse } as MsgRemoveX509CertResponse
while (reader.pos < end) {
const tag = reader.uint32()
switch (tag >>> 3) {
default:
reader.skipType(tag & 7)
break
}
}
return message
},

fromJSON(_: any): MsgRemoveX509CertResponse {
const message = { ...baseMsgRemoveX509CertResponse } as MsgRemoveX509CertResponse
return message
},

toJSON(_: MsgRemoveX509CertResponse): unknown {
const obj: any = {}
return obj
},

fromPartial(_: DeepPartial<MsgRemoveX509CertResponse>): MsgRemoveX509CertResponse {
const message = { ...baseMsgRemoveX509CertResponse } as MsgRemoveX509CertResponse
return message
}
}

/** Msg defines the Msg service. */
export interface Msg {
ProposeAddX509RootCert(request: MsgProposeAddX509RootCert): Promise<MsgProposeAddX509RootCertResponse>
Expand All @@ -2118,8 +2289,8 @@ export interface Msg {
AddPkiRevocationDistributionPoint(request: MsgAddPkiRevocationDistributionPoint): Promise<MsgAddPkiRevocationDistributionPointResponse>
UpdatePkiRevocationDistributionPoint(request: MsgUpdatePkiRevocationDistributionPoint): Promise<MsgUpdatePkiRevocationDistributionPointResponse>
DeletePkiRevocationDistributionPoint(request: MsgDeletePkiRevocationDistributionPoint): Promise<MsgDeletePkiRevocationDistributionPointResponse>
/** this line is used by starport scaffolding # proto/tx/rpc */
AssignVid(request: MsgAssignVid): Promise<MsgAssignVidResponse>
RemoveX509Cert(request: MsgRemoveX509Cert): Promise<MsgRemoveX509CertResponse>
}

export class MsgClientImpl implements Msg {
Expand Down Expand Up @@ -2192,6 +2363,12 @@ export class MsgClientImpl implements Msg {
const promise = this.rpc.request('zigbeealliance.distributedcomplianceledger.pki.Msg', 'AssignVid', data)
return promise.then((data) => MsgAssignVidResponse.decode(new Reader(data)))
}

RemoveX509Cert(request: MsgRemoveX509Cert): Promise<MsgRemoveX509CertResponse> {
const data = MsgRemoveX509Cert.encode(request).finish()
const promise = this.rpc.request('zigbeealliance.distributedcomplianceledger.pki.Msg', 'RemoveX509Cert', data)
return promise.then((data) => MsgRemoveX509CertResponse.decode(new Reader(data)))
}
}

interface Rpc {
Expand Down
Loading

0 comments on commit c859d20

Please sign in to comment.